Merge branch 'fix-ansi-test-regression-on-aix' into maint
[platform/upstream/automake.git] / m4 / cond-if.m4
1 # AM_COND_IF                                            -*- Autoconf -*-
2
3 # Copyright (C) 2008, 2010 Free Software Foundation, Inc.
4 #
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.
8
9 # serial 3
10
11 # _AM_COND_IF
12 # _AM_COND_ELSE
13 # _AM_COND_ENDIF
14 # --------------
15 # These macros are only used for tracing.
16 m4_define([_AM_COND_IF])
17 m4_define([_AM_COND_ELSE])
18 m4_define([_AM_COND_ENDIF])
19
20
21 # AM_COND_IF(COND, [IF-TRUE], [IF-FALSE])
22 # ---------------------------------------
23 # If the shell condition COND is true, execute IF-TRUE, otherwise execute
24 # IF-FALSE.  Allow automake to learn about conditional instantiating macros
25 # (the AC_CONFIG_FOOS).
26 AC_DEFUN([AM_COND_IF],
27 [m4_ifndef([_AM_COND_VALUE_$1],
28            [m4_fatal([$0: no such condition "$1"])])dnl
29 _AM_COND_IF([$1])dnl
30 if test -z "$$1_TRUE"; then :
31   m4_n([$2])[]dnl
32 m4_ifval([$3],
33 [_AM_COND_ELSE([$1])dnl
34 else
35   $3
36 ])dnl
37 _AM_COND_ENDIF([$1])dnl
38 fi[]dnl
39 ])