Bug 1667008 [wpt PR 25754] - [css-flex] Change some test expectations for image flex...
[gecko.git] / build / autoconf / altoptions.m4
blobb6e365bdcb11734d586479eea754c93b0cea5f3d
1 dnl This Source Code Form is subject to the terms of the Mozilla Public
2 dnl License, v. 2.0. If a copy of the MPL was not distributed with this
3 dnl file, You can obtain one at http://mozilla.org/MPL/2.0/.
5 dnl altoptions.m4 - An alternative way of specifying command-line options.
6 dnl    These macros are needed to support a menu-based configurator.
7 dnl    This file also includes the macro, AM_READ_MYCONFIG, for reading
8 dnl    the 'myconfig.m4' file.
10 dnl Send comments, improvements, bugs to Steve Lamm (slamm@netscape.com).
13 dnl MOZ_ARG_ENABLE_BOOL(           NAME, HELP, IF-YES [, IF-NO [, ELSE]])
14 dnl MOZ_ARG_DISABLE_BOOL(          NAME, HELP, IF-NO [, IF-YES [, ELSE]])
15 dnl MOZ_ARG_ENABLE_STRING(         NAME, HELP, IF-SET [, ELSE])
16 dnl MOZ_ARG_WITH_BOOL(             NAME, HELP, IF-YES [, IF-NO [, ELSE])
17 dnl MOZ_ARG_WITH_STRING(           NAME, HELP, IF-SET [, ELSE])
18 dnl MOZ_ARG_HEADER(Comment)
19 dnl MOZ_READ_MYCONFIG() - Read in 'myconfig.sh' file
21 define([MOZ_DIVERSION_ARGS], 12)
23 AC_DEFUN([MOZ_ARG],[dnl
24 AC_DIVERT_PUSH(MOZ_DIVERSION_ARGS)dnl
25     '$1',
26 AC_DIVERT_POP()dnl
28 AC_DEFUN([MOZ_AC_ARG_ENABLE],[MOZ_ARG([--enable-]translit([$1],[_],[-]))AC_ARG_ENABLE([$1], [$2], [$3], [$4])])
29 AC_DEFUN([MOZ_AC_ARG_WITH],[MOZ_ARG([--with-]translit([$1],[_],[-]))AC_ARG_WITH([$1], [$2], [$3], [$4])])
31 dnl MOZ_TWO_STRING_TEST(NAME, VAL, STR1, IF-STR1, STR2, IF-STR2 [, ELSE])
32 AC_DEFUN([MOZ_TWO_STRING_TEST],
33 [if test "[$2]" = "[$3]"; then
34     ifelse([$4], , :, [$4])
35   elif test "[$2]" = "[$5]"; then
36     ifelse([$6], , :, [$6])
37   else
38     ifelse([$7], ,
39       [AC_MSG_ERROR([Option, [$1], does not take an argument ([$2]).])],
40       [$7])
41   fi])
43 dnl MOZ_ARG_ENABLE_BOOL(NAME, HELP, IF-YES [, IF-NO [, ELSE]])
44 AC_DEFUN([MOZ_ARG_ENABLE_BOOL],
45 [MOZ_AC_ARG_ENABLE([$1], [$2],
46  [MOZ_TWO_STRING_TEST([$1], [$enableval], yes, [$3], no, [$4])],
47  [$5])])
49 dnl MOZ_ARG_DISABLE_BOOL(NAME, HELP, IF-NO [, IF-YES [, ELSE]])
50 AC_DEFUN([MOZ_ARG_DISABLE_BOOL],
51 [MOZ_AC_ARG_ENABLE([$1], [$2],
52  [MOZ_TWO_STRING_TEST([$1], [$enableval], no, [$3], yes, [$4])],
53  [$5])])
55 dnl MOZ_ARG_ENABLE_STRING(NAME, HELP, IF-SET [, ELSE])
56 AC_DEFUN([MOZ_ARG_ENABLE_STRING],
57 [MOZ_AC_ARG_ENABLE([$1], [$2], [$3], [$4])])
59 dnl MOZ_ARG_WITH_BOOL(NAME, HELP, IF-YES [, IF-NO [, ELSE])
60 AC_DEFUN([MOZ_ARG_WITH_BOOL],
61 [MOZ_AC_ARG_WITH([$1], [$2],
62  [MOZ_TWO_STRING_TEST([$1], [$withval], yes, [$3], no, [$4])],
63  [$5])])
65 dnl MOZ_ARG_WITH_STRING(NAME, HELP, IF-SET [, ELSE])
66 AC_DEFUN([MOZ_ARG_WITH_STRING],
67 [MOZ_AC_ARG_WITH([$1], [$2], [$3], [$4])])
69 dnl MOZ_ARG_HEADER(Comment)
70 dnl This is used by webconfig to group options
71 define(MOZ_ARG_HEADER, [# $1])
73 dnl MOZ_READ_MYCONFIG() - Read in 'myconfig.sh' file
74 AC_DEFUN([MOZ_READ_MOZCONFIG],
75 [AC_REQUIRE([AC_INIT_BINSH])dnl
76 . ./old-configure.vars