This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Add probe for strptime
[metaconfig.git] / U / perl / d_futimes.U
1 ?RCS: $Id$
2 ?RCS:
3 ?RCS: Copyright (c) 2000 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_futimes: Compile cat rm_try run
9 ?MAKE:  -pick add $@ %<
10 ?S:d_futimes:
11 ?S:     This variable conditionally defines the HAS_FUTIMES symbol, which
12 ?S:     indicates to the C program that the futimes() routine is available.
13 ?S:.
14 ?C:HAS_FUTIMES:
15 ?C:     This symbol, if defined, indicates that the futimes routine is
16 ?C:     available to change file descriptor time stamps with struct timevals.
17 ?C:.
18 ?H:#$d_futimes HAS_FUTIMES              /**/
19 ?H:.
20 ?T:rc
21 ?F:!try
22 : check for a working futimes
23 d_futimes="$undef"
24 echo " "
25 echo "Checking if you have a working futimes()" >&4
26 $cat >try.c <<EOCP
27 #include <stdio.h>
28 #include <sys/time.h>
29 #include <errno.h>
30 #include <fcntl.h>
31
32 int main ()
33 {
34     int fd, rv;
35     fd = open ("try.c", O_RDWR);
36     if (-1 == fd) exit (1);
37     rv = futimes (fd, NULL);
38     exit (rv == -1 ? errno : 0);
39 }
40 EOCP
41 set try
42 if eval $compile; then
43     `$run ./try`
44     rc=$?
45     case "$rc" in
46         0)  echo "Yes, you have" >&4
47             d_futimes="$define"
48             ;;
49         *)  echo "No, you have futimes, but it isn't working ($rc) (probably harmless)" >&4
50             ;;
51     esac
52 else
53     echo "No, it does not (probably harmless)" >&4
54 fi
55 $rm_try
56