doc: update Vala documentation
[automake.git] / m4 / cond-if.m4
blob3b0b52659c733a070393c34d42211d40ad9cddaf
1 # AM_COND_IF                                            -*- Autoconf -*-
3 # Copyright (C) 2008-2024 Free Software Foundation, Inc.
5 # This file is free software; the Free Software Foundation
6 # gives unlimited permission to copy and/or distribute it,
7 # with or without modifications, as long as this notice is preserved.
9 # _AM_COND_IF
10 # _AM_COND_ELSE
11 # _AM_COND_ENDIF
12 # --------------
13 # These macros are only used for tracing.
14 m4_define([_AM_COND_IF])
15 m4_define([_AM_COND_ELSE])
16 m4_define([_AM_COND_ENDIF])
18 # AM_COND_IF(COND, [IF-TRUE], [IF-FALSE])
19 # ---------------------------------------
20 # If the shell condition COND is true, execute IF-TRUE, otherwise execute
21 # IF-FALSE.  Allow automake to learn about conditional instantiating macros
22 # (the AC_CONFIG_FOOS).
23 AC_DEFUN([AM_COND_IF],
24 [m4_ifndef([_AM_COND_VALUE_$1],
25            [m4_fatal([$0: no such condition "$1"])])dnl
26 _AM_COND_IF([$1])dnl
27 if test -z "$$1_TRUE"; then :
28   m4_n([$2])[]dnl
29 m4_ifval([$3],
30 [_AM_COND_ELSE([$1])dnl
31 else
32   $3
33 ])dnl
34 _AM_COND_ENDIF([$1])dnl
35 fi[]dnl