|
1 | 1 | # gp-sleep.m4 - look for the sleep(1) tool -*- Autoconf -*-
|
2 |
| -# serial 13 |
| 2 | +# serial 14 |
3 | 3 | dnl | Increment the above serial number every time you edit this file.
|
4 | 4 | dnl | When it finds multiple m4 files with the same name,
|
5 | 5 | dnl | aclocal will use the one with the highest serial.
|
6 | 6 | dnl
|
7 | 7 | dnl ####################################################################
|
8 | 8 | dnl GP_SLEEP(delay_in_whole_seconds)
|
9 |
| -dnl If the SLEEP variable is set to "no" or empty or is unset, |
10 |
| -dnl do not sleep. |
11 |
| -dnl If the SLEEP variable is set to something else, run that something |
12 |
| -dnl else with the given delay value. |
| 9 | +dnl * If the SLEEP variable is set to "no" or empty or is unset, |
| 10 | +dnl do not sleep. |
| 11 | +dnl * If stdout (FD 1) is not a TTY (!isatty(1)), do not sleep. |
| 12 | +dnl * Otherwise, run ${SLEEP} with the given delay value argument. |
13 | 13 | dnl ####################################################################
|
| 14 | +dnl |
| 15 | +dnl #################################################################### |
| 16 | +dnl GP_SLEEP_IF_TTY(delay_in_whole_seconds) |
| 17 | +dnl * If the SLEEP variable is set to "no" or empty or is unset, |
| 18 | +dnl do not sleep. |
| 19 | +dnl * If stdout (FD 1) is not a TTY (!isatty(1)), do not sleep. |
| 20 | +dnl * If tty -t is not present and therefore fails, we do not lose |
| 21 | +dnl much: Just that interactive users do not benefit from seeing the |
| 22 | +dnl warning a bit longer. |
| 23 | +dnl * Otherwise, run ${SLEEP} with the given delay value argument. |
| 24 | +dnl #################################################################### |
| 25 | +dnl |
14 | 26 | AC_DEFUN_ONCE([_GP_SLEEP_INIT], [dnl
|
15 | 27 | AC_REQUIRE([GP_PROG_SLEEP])dnl
|
16 |
| -AS_IF([test "x$SLEEP" != "x" && test "x$SLEEP" != "xno"], [dnl |
17 |
| -gp_sleep=[$]SLEEP |
| 28 | +AC_MSG_CHECKING([whether configure script should sleep]) |
| 29 | +AS_IF([test "x$SLEEP" != x && test "x$SLEEP" != xno], [dnl |
| 30 | + AC_MSG_RESULT([yes]) |
| 31 | + gp_sleep=[$]SLEEP |
18 | 32 | ], [dnl
|
19 |
| -gp_sleep=: |
| 33 | + AC_MSG_RESULT([no]) |
| 34 | + gp_sleep=: |
20 | 35 | ])
|
21 | 36 | ])dnl
|
22 | 37 | dnl
|
23 | 38 | dnl
|
24 | 39 | AC_DEFUN([GP_SLEEP], [dnl
|
25 | 40 | AC_REQUIRE([_GP_SLEEP_INIT])dnl
|
26 |
| -$gp_sleep $1 |
| 41 | +[$]gp_sleep $1 |
| 42 | +])dnl |
| 43 | +dnl |
| 44 | +AC_DEFUN([GP_SLEEP_IF_TTY], [dnl |
| 45 | +AC_REQUIRE([_GP_SLEEP_INIT])dnl |
| 46 | +AS_IF([test -t 1], [dnl |
| 47 | +[$]gp_sleep $1 |
| 48 | +]) |
27 | 49 | ])dnl
|
28 | 50 | dnl
|
29 | 51 | dnl
|
|
0 commit comments