dnl This Source Code Form is subject to the terms of the Mozilla Public dnl License, v. 2.0. If a copy of the MPL was not distributed with this dnl file, You can obtain one at http://mozilla.org/MPL/2.0/. dnl For use in AC_SUBST replacement define([MOZ_DIVERSION_SUBST], 11) dnl Replace AC_SUBST to store values in a format suitable for python. dnl The necessary comma after the tuple can't be put here because it dnl can mess around with things like: dnl AC_SOMETHING(foo,AC_SUBST(),bar) define([AC_SUBST], [ifdef([AC_SUBST_$1], , [define([AC_SUBST_$1], )dnl AC_DIVERT_PUSH(MOZ_DIVERSION_SUBST)dnl (''' $1 ''', r''' [$]$1 ''') AC_DIVERT_POP()dnl ])]) dnl Wrap AC_DEFINE to store values in a format suitable for python. dnl autoconf's AC_DEFINE still needs to be used to fill confdefs.h, dnl which is #included during some compile checks. dnl The necessary comma after the tuple can't be put here because it dnl can mess around with things like: dnl AC_SOMETHING(foo,AC_DEFINE(),bar) define([_MOZ_AC_DEFINE], defn([AC_DEFINE])) define([AC_DEFINE], [cat >> confdefs.pytmp <<\EOF (''' $1 ''', ifelse($#, 2, [r''' $2 '''], $#, 3, [r''' $2 '''], ' 1 ')) EOF ifelse($#, 2, _MOZ_AC_DEFINE([$1], [$2]), $#, 3, _MOZ_AC_DEFINE([$1], [$2], [$3]),_MOZ_AC_DEFINE([$1]))dnl ]) dnl Wrap AC_DEFINE_UNQUOTED to store values in a format suitable for dnl python. define([_MOZ_AC_DEFINE_UNQUOTED], defn([AC_DEFINE_UNQUOTED])) define([AC_DEFINE_UNQUOTED], [cat >> confdefs.pytmp <>>)dnl echo creating $CONFIG_STATUS extra_python_path=${COMM_BUILD:+"'mozilla', "} cat > $CONFIG_STATUS <>>), topsrcdir) topsrcdir = os.path.normpath(os.path.abspath(rel)) topobjdir = os.path.abspath(os.path.dirname(<<<__file__>>>)) dnl All defines and substs are stored with an additional space at the beginning dnl and at the end of the string, to avoid any problem with values starting or dnl ending with quotes. defines = [(name[1:-1], value[1:-1]) for name, value in [ EOF dnl confdefs.pytmp contains AC_DEFINEs, in the expected format, but dnl lacks the final comma (see above). sed 's/$/,/' confdefs.pytmp >> $CONFIG_STATUS rm confdefs.pytmp confdefs.h cat >> $CONFIG_STATUS <<\EOF ] ] substs = [(name[1:-1], value[1:-1]) for name, value in [ EOF dnl The MOZ_DIVERSION_SUBST output diversion contains AC_SUBSTs, in the dnl expected format, but lacks the final comma (see above). sed 's/$/,/' >> $CONFIG_STATUS <> $CONFIG_STATUS done cat >> $CONFIG_STATUS <<\EOF ] ] dnl List of AC_DEFINEs that aren't to be exposed in ALLDEFINES non_global_defines = [ EOF if test -n "$_NON_GLOBAL_ACDEFINES"; then for var in $_NON_GLOBAL_ACDEFINES; do echo " '$var'," >> $CONFIG_STATUS done fi cat >> $CONFIG_STATUS <