This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
metaconfig: more thready fixes.
[metaconfig.git] / U / threads / d_localtime_r.U
1 ?RCS: $Id$
2 ?RCS:
3 ?RCS: Copyright (c) 1999 Jarkko Hietaniemi
4 ?RCS:
5 ?RCS: You may distribute under the terms of either the GNU General Public
6 ?RCS: License or the Artistic License, as specified in the README file.
7 ?RCS:
8 ?MAKE:d_localtime_r localtime_r_proto: Inlibc Protochk i_systypes i_time
9 ?MAKE:  -pick add $@ %<
10 ?S:d_localtime_r:
11 ?S:     This variable conditionally defines the HAS_LOCALTIME_R symbol,
12 ?S:     which indicates to the C program that the localtime_r()
13 ?S:     routine is available.
14 ?S:.
15 ?S:localtime_r_proto:
16 ?S:     This variable encodes the prototype of localtime_r.
17 ?S:.
18 ?C:HAS_LOCALTIME_R:
19 ?C:     This symbol, if defined, indicates that the localtime_r routine
20 ?C:     is available to localtime re-entrantly.
21 ?C:.
22 ?C:LOCALTIME_R_PROTO:
23 ?C:     This symbol encodes the prototype of localtime_r.
24 ?C:       1     int        localtime_r(time_t *, struct tm*)
25 ?C:       2     struct tm* localtime_r(time_t *, struct tm*)
26 ?C:     The 2 is preferred since it's the SUSv3/POSIX 1001.3-2001 one.
27 ?C:.
28 ?H:#$d_localtime_r HAS_LOCALTIME_R              /**/
29 ?H:#define LOCALTIME_R_PROTO $localtime_r_proto /**/
30 ?H:.
31 ?T:try hdrs
32 ?LINT:set d_localtime_r
33 : see if localtime_r exists
34 set localtime_r d_localtime_r
35 eval $inlibc
36 case "$d_localtime_r" in
37 "$define")
38         hdrs="$i_systypes sys/types.h $i_time time.h"
39         try='extern struct tm* localtime_r(time_t *, struct tm*);'
40         if ./protochk "$try" $hdrs; then
41                 echo "Your system has $try"
42                 localtime_r_proto=2
43         else
44                 try='extern int localtime_r(time_t *, struct tm*);'
45                 if ./protochk "$try" $hdrs; then
46                         echo "Your system has $try"
47                         localtime_r_proto=1
48                 else
49                         echo "I do not recognize the prototype of your localtime_r, not using it." >&4
50                         d_localtime_r="$undef"
51                         localtime_r_proto=0
52                 fi
53         fi
54         ;;
55 *)      localtime_r_proto=0 ;;
56 esac
57