am-ft: make the environment available earlier
[platform/upstream/automake.git] / m4 / cond-if.m4
index 9f2611e..b6b372d 100644 (file)
@@ -1,13 +1,11 @@
 # AM_COND_IF                                            -*- Autoconf -*-
 
-# Copyright (C) 2008 Free Software Foundation, Inc.
+# Copyright (C) 2008-2013 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 1
-
 # _AM_COND_IF
 # _AM_COND_ELSE
 # _AM_COND_ENDIF
@@ -17,18 +15,17 @@ m4_define([_AM_COND_IF])
 m4_define([_AM_COND_ELSE])
 m4_define([_AM_COND_ENDIF])
 
-
 # AM_COND_IF(COND, [IF-TRUE], [IF-FALSE])
 # ---------------------------------------
-# If the shell condition matching COND is true, execute IF-TRUE,
-# otherwise execute IF-FALSE.  Allow automake to learn about conditional
-# instantiating macros (the AC_CONFIG_FOOS).
+# If the shell condition COND is true, execute IF-TRUE, otherwise execute
+# IF-FALSE.  Allow automake to learn about conditional instantiating macros
+# (the AC_CONFIG_FOOS).
 AC_DEFUN([AM_COND_IF],
 [m4_ifndef([_AM_COND_VALUE_$1],
           [m4_fatal([$0: no such condition "$1"])])dnl
 _AM_COND_IF([$1])dnl
-if _AM_COND_VALUE_$1; then
-  m4_default([$2], [:])
+if test -z "$$1_TRUE"; then :
+  m4_n([$2])[]dnl
 m4_ifval([$3],
 [_AM_COND_ELSE([$1])dnl
 else