This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
metaconfig: three guesses.
[metaconfig.git] / U / threads / d_ttyname_r.U
1 ?MAKE:d_ttyname_r ttyname_r_proto: Inlibc Protochk i_systypes i_unistd
2 ?MAKE:  -pick add $@ %<
3 ?S:d_ttyname_r:
4 ?S:     This variable conditionally defines the HAS_TTYNAME_R symbol,
5 ?S:     which indicates to the C program that the ttyname_r()
6 ?S:     routine is available.
7 ?S:.
8 ?S:ttyname_r_proto:
9 ?S:     This variable encodes the prototype of ttyname_r.
10 ?S:.
11 ?C:HAS_TTYNAME_R:
12 ?C:     This symbol, if defined, indicates that the ttyname_r routine
13 ?C:     is available to ttyname re-entrantly.
14 ?C:.
15 ?C:TTYNAME_R_PROTO:
16 ?C:     This symbol encodes the prototype of ttyname_r.
17 ?C:.
18 ?H:#$d_ttyname_r HAS_TTYNAME_R     /**/
19 ?H:#define TTYNAME_R_PROTO $ttyname_r_proto        /**/
20 ?H:.
21 ?T:try hdrs
22 ?LINT:set d_ttyname_r
23 ?LINT:set ttyname_r_proto
24 : see if ttyname_r exists
25 set ttyname_r d_ttyname_r
26 eval $inlibc
27 case "$d_ttyname_r" in
28 "$define")
29         hdrs="$i_systypes sys/types.h $i_unistd unistd.h"
30         case "$ttyname_r_proto" in
31         '')     try='extern int ttyname_r(int, char*, size_t);'
32                 ./protochk "$try" $hdrs && ttyname_r_proto=I_IBW;
33         ;;
34         esac
35         case "$ttyname_r_proto" in
36         '')     try='extern int ttyname_r(int, char*, int);'
37                 ./protochk "$try" $hdrs && ttyname_r_proto=I_IBI;
38         ;;
39         esac
40         case "$ttyname_r_proto" in
41         '')     try='extern char* ttyname_r(int, char*, int);'
42                 ./protochk "$try" $hdrs && ttyname_r_proto=B_IBI;
43         ;;
44         esac
45         case "$ttyname_r_proto" in
46         '') d_ttyname_r=undef ; echo "Disabling ttyname_r, cannot find prototype." ;;
47         * ) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ; echo "$try" ;;
48         esac
49         ;;
50 esac
51