Hash :
e19a2988
Author :
Date :
2008-03-26T07:00:44
Implement conditional AC_CONFIG_FILES: AM_COND_IF. * automake.in (%ac_config_files_condition): New. (scan_autoconf_config_files): Record condition if any. (scan_autoconf_traces): Trace _AM_COND_IF, _AM_COND_ELSE, _AM_COND_ENDIF, updating @cond_stack as appropriate. (handle_configure): Prefix config.status rule with condition. Check that m4 quotation is done consistently. * m4/cond.m4 (AM_CONDITION): Define `_AM_COND_VALUE_name' with `name' being the name of the condition, to its shell condition. * m4/cond-if.m4: New file. (_AM_COND_IF, _AM_COND_ELSE, _AM_COND_ENDIF): New trace helpers. (AM_COND_IF): New macro, implements conditionals. * m4/Makefile.am: Adjust. * doc/automake.texi (Requirements, Optional, Conditionals): Document AM_COND_IF. * NEWS: Update. * tests/cond39.test, tests/cond40.test, tests/cond41.test, tests/cond42.test, tests/cond43.test: New tests. * tests/Makefile.am: Adjust. Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
# AM_CONDITIONAL -*- Autoconf -*-
# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
# 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 9
# AM_CONDITIONAL(NAME, SHELL-CONDITION)
# -------------------------------------
# Define a conditional.
AC_DEFUN([AM_CONDITIONAL],
[AC_PREREQ(2.52)dnl
ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
AC_SUBST([$1_TRUE])dnl
AC_SUBST([$1_FALSE])dnl
_AM_SUBST_NOTMAKE([$1_TRUE])dnl
_AM_SUBST_NOTMAKE([$1_FALSE])dnl
m4_define([_AM_COND_VALUE_$1], [$2])dnl
if $2; then
$1_TRUE=
$1_FALSE='#'
else
$1_TRUE='#'
$1_FALSE=
fi
AC_CONFIG_COMMANDS_PRE(
[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
AC_MSG_ERROR([[conditional "$1" was never defined.
Usually this means the macro was only invoked conditionally.]])
fi])])