File: aclocal_runlog.m4

package info (click to toggle)
armci-mpi 0.0~git20160222-2
  • links: PTS
  • area: main
  • in suites: stretch
  • size: 1,756 kB
  • sloc: ansic: 12,698; sh: 229; makefile: 53; fortran: 44
file content (64 lines) | stat: -rw-r--r-- 1,863 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
dnl
dnl PAC_RUN_LOG mimics _AC_RUN_LOG which is autoconf internal routine.
dnl We also make sure PAC_RUN_LOG can be used in AS_IF, so the last
dnl test command should have terminating ]), i.e. without newline before ]).
dnl
AC_DEFUN([PAC_RUNLOG],[
{ AS_ECHO(["$as_me:$LINENO: $1"]) >&AS_MESSAGE_LOG_FD
  (eval $1) 2>&AS_MESSAGE_LOG_FD
  ac_status=$?
  AS_ECHO(["$as_me:$LINENO: \$? = $ac_status"]) >&AS_MESSAGE_LOG_FD
  test $ac_status = 0; }])
dnl
dnl PAC_COMMAND_IFELSE is written to replace AC_TRY_EVAL with added logging
dnl to config.log, i.e. AC_TRY_EVAL does not log anything to config.log.
dnl If autoconf provides AC_COMMAND_IFELSE or AC_EVAL_IFELSE,
dnl AC_COMMAND_IFELSE dnl should be replaced by the official autoconf macros.
dnl
dnl PAC_COMMAND_IFELSE(COMMMAND,[ACTION-IF-RUN-OK],[ACTION-IF-RUN-FAIL])
dnl
AC_DEFUN([PAC_COMMAND_IFELSE],[
dnl Should use _AC_DO_TOKENS but use AC_RUN_LOG instead
dnl because _AC_XX is autoconf's undocumented macro.
AS_IF([PAC_RUNLOG([$1])],[
    $2
],[
    AS_ECHO(["$as_me: program exited with status $ac_status"]) >&AS_MESSAGE_LOG_FD
    m4_ifvaln([$3],[
        (exit $ac_status)
        $3
    ])
])
])
dnl
dnl
dnl
AC_DEFUN([PAC_EVAL_IFELSE],[
dnl Should use _AC_DO_TOKENS but use AC_RUN_LOG instead
dnl because _AC_XX is autoconf's undocumented macro.
AS_IF([PAC_RUNLOG([$$1])],[
    $2
],[
    AS_ECHO(["$as_me: program exited with status $ac_status"]) >&AS_MESSAGE_LOG_FD
    m4_ifvaln([$3],[
        (exit $ac_status)
        $3
    ])
])
])
dnl
dnl
dnl
AC_DEFUN([PAC_RUNLOG_IFELSE],[
dnl pac_TESTLOG is the internal temporary logfile for this macro.
pac_TESTLOG="pac_test.log"
rm -f $pac_TESTLOG
PAC_COMMAND_IFELSE([$1 > $pac_TESTLOG],[
    ifelse([$2],[],[],[$2])
],[
    AS_ECHO(["*** $1 :"]) >&AS_MESSAGE_LOG_FD
    cat $pac_TESTLOG >&AS_MESSAGE_LOG_FD
    ifelse([$3],[],[],[$3])
])
rm -f $pac_TESTLOG
])