tests: fix spurious failure due to autom4te caching
[automake.git] / m4 / options.m4
blob6824d84fad344478dd60a361ac7194be94c244a8
1 # Helper functions for option handling.                     -*- Autoconf -*-
3 # Copyright (C) 2001, 2002, 2003, 2005, 2008, 2010 Free Software
4 # Foundation, Inc.
6 # This file is free software; the Free Software Foundation
7 # gives unlimited permission to copy and/or distribute it,
8 # with or without modifications, as long as this notice is preserved.
10 # serial 5
12 # _AM_MANGLE_OPTION(NAME)
13 # -----------------------
14 AC_DEFUN([_AM_MANGLE_OPTION],
15 [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
17 # _AM_SET_OPTION(NAME)
18 # --------------------
19 # Set option NAME.  Presently that only means defining a flag for this option.
20 AC_DEFUN([_AM_SET_OPTION],
21 [m4_define(_AM_MANGLE_OPTION([$1]), 1)])
23 # _AM_SET_OPTIONS(OPTIONS)
24 # ------------------------
25 # OPTIONS is a space-separated list of Automake options.
26 AC_DEFUN([_AM_SET_OPTIONS],
27 [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
29 # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
30 # -------------------------------------------
31 # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
32 AC_DEFUN([_AM_IF_OPTION],
33 [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])