Bug 1867925 - Mark some storage-access-api tests as intermittent after wpt-sync....
[gecko.git] / build / autoconf / config.status.m4
blob41571a414b5b0f0e476f57957ccf26dcc6e7b65a
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 For use in AC_SUBST replacement
6 define([MOZ_DIVERSION_SUBST], 11)
8 dnl Replace AC_SUBST to store values in a format suitable for python.
9 dnl The necessary comma after the tuple can't be put here because it
10 dnl can mess around with things like:
11 dnl    AC_SOMETHING(foo,AC_SUBST(),bar)
12 define([AC_SUBST],
13 [ifdef([AC_SUBST_SET_$1], [m4_fatal([Cannot use AC_SUBST and AC_SUBST_SET on the same variable ($1)])],
14 [ifdef([AC_SUBST_LIST_$1], [m4_fatal([Cannot use AC_SUBST and AC_SUBST_LIST on the same variable ($1)])],
15 [ifdef([AC_SUBST_$1], ,
16 [define([AC_SUBST_$1], )dnl
17 AC_DIVERT_PUSH(MOZ_DIVERSION_SUBST)dnl
18     (''' $1 ''', r''' [$]$1 ''')
19 AC_DIVERT_POP()dnl
20 ])])])])])
22 dnl Like AC_SUBST, but makes the value available as a set in python,
23 dnl with values got from the value of the environment variable, split on
24 dnl whitespaces.
25 define([AC_SUBST_SET],
26 [ifdef([AC_SUBST_$1], [m4_fatal([Cannot use AC_SUBST and AC_SUBST_SET on the same variable ($1)])],
27 [ifdef([AC_SUBST_LIST_$1], [m4_fatal([Cannot use AC_SUBST_LIST and AC_SUBST_SET on the same variable ($1)])],
28 [ifdef([AC_SUBST_SET_$1], ,
29 [define([AC_SUBST_SET_$1], )dnl
30 AC_DIVERT_PUSH(MOZ_DIVERSION_SUBST)dnl
31     (''' $1 ''', unique_list(split(r''' [$]$1 ''')))
32 AC_DIVERT_POP()dnl
33 ])])])])])
35 dnl Like AC_SUBST, but makes the value available as a list in python,
36 dnl with values got from the value of the environment variable, split on
37 dnl whitespaces.
38 define([AC_SUBST_LIST],
39 [ifdef([AC_SUBST_$1], [m4_fatal([Cannot use AC_SUBST and AC_SUBST_LIST on the same variable ($1)])],
40 [ifdef([AC_SUBST_SET_$1], [m4_fatal([Cannot use AC_SUBST_SET and AC_SUBST_LIST on the same variable ($1)])],
41 [ifdef([AC_SUBST_LIST_$1], ,
42 [define([AC_SUBST_LIST_$1], )dnl
43 AC_DIVERT_PUSH(MOZ_DIVERSION_SUBST)dnl
44     (''' $1 ''', list(split(r''' [$]$1 ''')))
45 AC_DIVERT_POP()dnl
46 ])])])])])
48 dnl Ignore AC_SUBSTs for variables we don't have use for but that autoconf
49 dnl itself exports.
50 define([AC_SUBST_CFLAGS], )
51 define([AC_SUBST_CPPFLAGS], )
52 define([AC_SUBST_CXXFLAGS], )
53 define([AC_SUBST_FFLAGS], )
54 define([AC_SUBST_DEFS], )
55 define([AC_SUBST_LDFLAGS], )
56 define([AC_SUBST_LIBS], )
58 dnl Wrap AC_DEFINE to store values in a format suitable for python.
59 dnl autoconf's AC_DEFINE still needs to be used to fill confdefs.h,
60 dnl which is #included during some compile checks.
61 dnl The necessary comma after the tuple can't be put here because it
62 dnl can mess around with things like:
63 dnl    AC_SOMETHING(foo,AC_DEFINE(),bar)
64 define([_MOZ_AC_DEFINE], defn([AC_DEFINE]))
65 define([AC_DEFINE],
66 [cat >> confdefs.pytmp <<\EOF
67     (''' $1 ''', ifelse($#, 2, [r''' $2 '''], $#, 3, [r''' $2 '''], ' 1 '))
68 EOF
69 ifelse($#, 2, _MOZ_AC_DEFINE([$1], [$2]), $#, 3, _MOZ_AC_DEFINE([$1], [$2], [$3]),_MOZ_AC_DEFINE([$1]))dnl
72 dnl Wrap AC_DEFINE_UNQUOTED to store values in a format suitable for
73 dnl python.
74 define([_MOZ_AC_DEFINE_UNQUOTED], defn([AC_DEFINE_UNQUOTED]))
75 define([AC_DEFINE_UNQUOTED],
76 [cat >> confdefs.pytmp <<EOF
77     (''' $1 ''', ifelse($#, 2, [r''' $2 '''], $#, 3, [r''' $2 '''], ' 1 '))
78 EOF
79 ifelse($#, 2, _MOZ_AC_DEFINE_UNQUOTED($1, $2), $#, 3, _MOZ_AC_DEFINE_UNQUOTED($1, $2, $3),_MOZ_AC_DEFINE_UNQUOTED($1))dnl
82 dnl Replace AC_OUTPUT to create and call a python config.status
83 define([MOZ_CREATE_CONFIG_STATUS],
84 [dnl Used in all Makefile.in files
85 top_srcdir=$srcdir
86 AC_SUBST(top_srcdir)
88 dnl Picked from autoconf 2.13
89 trap '' 1 2 15
90 AC_CACHE_SAVE
92 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
93 : ${CONFIG_STATUS=./config.data}
95 dnl We're going to need [ ] for python syntax.
96 changequote(<<<, >>>)dnl
97 echo creating $CONFIG_STATUS
99 cat > $CONFIG_STATUS <<EOF
101 dnl All defines and substs are stored with an additional space at the beginning
102 dnl and at the end of the string, to avoid any problem with values starting or
103 dnl ending with quotes.
104 defines = [
107 dnl confdefs.pytmp contains AC_DEFINEs, in the expected format, but
108 dnl lacks the final comma (see above).
109 sed 's/$/,/' confdefs.pytmp >> $CONFIG_STATUS
110 rm confdefs.pytmp confdefs.h
112 cat >> $CONFIG_STATUS <<\EOF
115 substs = [
118 dnl The MOZ_DIVERSION_SUBST output diversion contains AC_SUBSTs, in the
119 dnl expected format, but lacks the final comma (see above).
120 sed 's/$/,/' >> $CONFIG_STATUS <<EOF
121 undivert(MOZ_DIVERSION_SUBST)dnl
124 dnl Add in the output from the subconfigure script
125 for ac_subst_arg in $_subconfigure_ac_subst_args; do
126   variable='$'$ac_subst_arg
127   echo "    (''' $ac_subst_arg ''', r''' `eval echo $variable` ''')," >> $CONFIG_STATUS
128 done
130 cat >> $CONFIG_STATUS <<\EOF
133 flags = [
134 undivert(MOZ_DIVERSION_ARGS)dnl
138 changequote([, ])
141 define([m4_fatal],[
142 errprint([$1
144 m4exit(1)
147 define([AC_OUTPUT], [ifelse($#_$1, 1_, [MOZ_CREATE_CONFIG_STATUS()
148 MOZ_RUN_CONFIG_STATUS()],
149 [m4_fatal([Use CONFIGURE_SUBST_FILES in moz.build files to create substituted files.])]
152 define([AC_CONFIG_HEADER],
153 [m4_fatal([Use CONFIGURE_DEFINE_FILES in moz.build files to produce header files.])