2012-05-21 15:12:37 +04:00
|
|
|
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/.
|
1999-02-05 01:52:56 +03:00
|
|
|
|
|
|
|
dnl altoptions.m4 - An alternative way of specifying command-line options.
|
|
|
|
dnl These macros are needed to support a menu-based configurator.
|
|
|
|
dnl This file also includes the macro, AM_READ_MYCONFIG, for reading
|
|
|
|
dnl the 'myconfig.m4' file.
|
|
|
|
|
|
|
|
dnl Send comments, improvements, bugs to Steve Lamm (slamm@netscape.com).
|
|
|
|
|
|
|
|
|
1999-02-05 03:10:25 +03:00
|
|
|
dnl MOZ_ARG_ENABLE_BOOL( NAME, HELP, IF-YES [, IF-NO [, ELSE]])
|
|
|
|
dnl MOZ_ARG_DISABLE_BOOL( NAME, HELP, IF-NO [, IF-YES [, ELSE]])
|
|
|
|
dnl MOZ_ARG_ENABLE_STRING( NAME, HELP, IF-SET [, ELSE])
|
|
|
|
dnl MOZ_ARG_ENABLE_BOOL_OR_STRING( NAME, HELP, IF-YES, IF-NO, IF-SET[, ELSE]]])
|
|
|
|
dnl MOZ_ARG_WITH_BOOL( NAME, HELP, IF-YES [, IF-NO [, ELSE])
|
|
|
|
dnl MOZ_ARG_WITHOUT_BOOL( NAME, HELP, IF-NO [, IF-YES [, ELSE])
|
|
|
|
dnl MOZ_ARG_WITH_STRING( NAME, HELP, IF-SET [, ELSE])
|
1999-02-19 20:25:47 +03:00
|
|
|
dnl MOZ_ARG_HEADER(Comment)
|
1999-02-05 03:10:25 +03:00
|
|
|
dnl MOZ_READ_MYCONFIG() - Read in 'myconfig.sh' file
|
|
|
|
|
2016-03-04 11:31:10 +03:00
|
|
|
define([MOZ_DIVERSION_ARGS], 12)
|
|
|
|
|
|
|
|
AC_DEFUN([MOZ_ARG],[dnl
|
|
|
|
AC_DIVERT_PUSH(MOZ_DIVERSION_ARGS)dnl
|
|
|
|
'$1',
|
|
|
|
AC_DIVERT_POP()dnl
|
|
|
|
])
|
|
|
|
AC_DEFUN([MOZ_AC_ARG_ENABLE],[MOZ_ARG([--enable-]translit([$1],[_],[-]))AC_ARG_ENABLE([$1], [$2], [$3], [$4])])
|
|
|
|
AC_DEFUN([MOZ_AC_ARG_WITH],[MOZ_ARG([--with-]translit([$1],[_],[-]))AC_ARG_WITH([$1], [$2], [$3], [$4])])
|
1999-02-05 03:10:25 +03:00
|
|
|
|
2001-10-30 01:59:31 +03:00
|
|
|
dnl MOZ_TWO_STRING_TEST(NAME, VAL, STR1, IF-STR1, STR2, IF-STR2 [, ELSE])
|
2006-05-16 09:39:16 +04:00
|
|
|
AC_DEFUN([MOZ_TWO_STRING_TEST],
|
2001-10-30 01:59:31 +03:00
|
|
|
[if test "[$2]" = "[$3]"; then
|
|
|
|
ifelse([$4], , :, [$4])
|
|
|
|
elif test "[$2]" = "[$5]"; then
|
|
|
|
ifelse([$6], , :, [$6])
|
1999-02-05 01:52:56 +03:00
|
|
|
else
|
2001-10-30 01:59:31 +03:00
|
|
|
ifelse([$7], ,
|
|
|
|
[AC_MSG_ERROR([Option, [$1], does not take an argument ([$2]).])],
|
|
|
|
[$7])
|
1999-02-05 01:52:56 +03:00
|
|
|
fi])
|
|
|
|
|
1999-02-05 03:10:25 +03:00
|
|
|
dnl MOZ_ARG_ENABLE_BOOL(NAME, HELP, IF-YES [, IF-NO [, ELSE]])
|
2006-05-16 09:39:16 +04:00
|
|
|
AC_DEFUN([MOZ_ARG_ENABLE_BOOL],
|
2016-03-04 11:31:10 +03:00
|
|
|
[MOZ_AC_ARG_ENABLE([$1], [$2],
|
2001-10-30 01:59:31 +03:00
|
|
|
[MOZ_TWO_STRING_TEST([$1], [$enableval], yes, [$3], no, [$4])],
|
1999-02-05 01:52:56 +03:00
|
|
|
[$5])])
|
|
|
|
|
1999-02-05 03:10:25 +03:00
|
|
|
dnl MOZ_ARG_DISABLE_BOOL(NAME, HELP, IF-NO [, IF-YES [, ELSE]])
|
2006-05-16 09:39:16 +04:00
|
|
|
AC_DEFUN([MOZ_ARG_DISABLE_BOOL],
|
2016-03-04 11:31:10 +03:00
|
|
|
[MOZ_AC_ARG_ENABLE([$1], [$2],
|
2001-10-30 01:59:31 +03:00
|
|
|
[MOZ_TWO_STRING_TEST([$1], [$enableval], no, [$3], yes, [$4])],
|
1999-02-05 01:52:56 +03:00
|
|
|
[$5])])
|
|
|
|
|
1999-02-05 03:10:25 +03:00
|
|
|
dnl MOZ_ARG_ENABLE_STRING(NAME, HELP, IF-SET [, ELSE])
|
2006-05-16 09:39:16 +04:00
|
|
|
AC_DEFUN([MOZ_ARG_ENABLE_STRING],
|
2016-03-04 11:31:10 +03:00
|
|
|
[MOZ_AC_ARG_ENABLE([$1], [$2], [$3], [$4])])
|
1999-02-05 01:52:56 +03:00
|
|
|
|
1999-02-05 03:10:25 +03:00
|
|
|
dnl MOZ_ARG_ENABLE_BOOL_OR_STRING(NAME, HELP, IF-YES, IF-NO, IF-SET[, ELSE]]])
|
2006-05-16 09:39:16 +04:00
|
|
|
AC_DEFUN([MOZ_ARG_ENABLE_BOOL_OR_STRING],
|
1999-02-05 01:52:56 +03:00
|
|
|
[ifelse([$5], ,
|
|
|
|
[errprint([Option, $1, needs an "IF-SET" argument.
|
|
|
|
])
|
|
|
|
m4exit(1)],
|
2016-03-04 11:31:10 +03:00
|
|
|
[MOZ_AC_ARG_ENABLE([$1], [$2],
|
2001-10-30 01:59:31 +03:00
|
|
|
[MOZ_TWO_STRING_TEST([$1], [$enableval], yes, [$3], no, [$4], [$5])],
|
1999-02-05 01:52:56 +03:00
|
|
|
[$6])])])
|
|
|
|
|
1999-02-05 03:10:25 +03:00
|
|
|
dnl MOZ_ARG_WITH_BOOL(NAME, HELP, IF-YES [, IF-NO [, ELSE])
|
2006-05-16 09:39:16 +04:00
|
|
|
AC_DEFUN([MOZ_ARG_WITH_BOOL],
|
2016-03-04 11:31:10 +03:00
|
|
|
[MOZ_AC_ARG_WITH([$1], [$2],
|
2001-10-30 01:59:31 +03:00
|
|
|
[MOZ_TWO_STRING_TEST([$1], [$withval], yes, [$3], no, [$4])],
|
1999-02-05 01:52:56 +03:00
|
|
|
[$5])])
|
|
|
|
|
1999-02-05 03:10:25 +03:00
|
|
|
dnl MOZ_ARG_WITHOUT_BOOL(NAME, HELP, IF-NO [, IF-YES [, ELSE])
|
2006-05-16 09:39:16 +04:00
|
|
|
AC_DEFUN([MOZ_ARG_WITHOUT_BOOL],
|
2016-03-04 11:31:10 +03:00
|
|
|
[MOZ_AC_ARG_WITH([$1], [$2],
|
2001-10-30 01:59:31 +03:00
|
|
|
[MOZ_TWO_STRING_TEST([$1], [$withval], no, [$3], yes, [$4])],
|
1999-02-05 01:52:56 +03:00
|
|
|
[$5])])
|
|
|
|
|
1999-02-05 03:10:25 +03:00
|
|
|
dnl MOZ_ARG_WITH_STRING(NAME, HELP, IF-SET [, ELSE])
|
2006-05-16 09:39:16 +04:00
|
|
|
AC_DEFUN([MOZ_ARG_WITH_STRING],
|
2016-03-04 11:31:10 +03:00
|
|
|
[MOZ_AC_ARG_WITH([$1], [$2], [$3], [$4])])
|
1999-02-05 01:52:56 +03:00
|
|
|
|
1999-02-19 20:25:47 +03:00
|
|
|
dnl MOZ_ARG_HEADER(Comment)
|
|
|
|
dnl This is used by webconfig to group options
|
|
|
|
define(MOZ_ARG_HEADER, [# $1])
|
1999-02-05 01:52:56 +03:00
|
|
|
|
1999-02-05 03:10:25 +03:00
|
|
|
dnl MOZ_READ_MYCONFIG() - Read in 'myconfig.sh' file
|
2006-05-16 09:39:16 +04:00
|
|
|
AC_DEFUN([MOZ_READ_MOZCONFIG],
|
1999-02-05 01:52:56 +03:00
|
|
|
[AC_REQUIRE([AC_INIT_BINSH])dnl
|
2016-03-04 11:31:10 +03:00
|
|
|
. ./old-configure.vars
|
Bug 762358 - Re-run configure when mozconfig changed in a significant way. r=gps
This adds a format option to mach environment and uses it in client.mk to
create a .mozconfig.json in the objdir, containing all the relevant data
from mozconfig. If the mozconfig doesn't change in a way that alters that
data, we still skip configure.
At the same time, use mach environment in place of mozconfig2configure and
mozconfig2client-mk, which makes us now have only one mozconfig reader.
Also, in the mozconfig reader, keep track of environment variables (as
opposed to shell variables), so that changes such as a variable that was
exported not being exported anymore is spotted. At the opposite, in order
for irrelevant environment variable changes not to incur in re-running
configure, only a set of environment variables are stored when they are
unmodified. Otherwise, changes such as using a different terminal window,
or even rebooting, would trigger reconfigures.
Finally, make mach environment emit both MOZ_OBJDIR and OBJDIR for
client.mk, and cleanup some objdir-related things in client.mk..
At the same time, make the mozconfig reader take MOZ_OBJDIR from the
environment if it is defined there and not in the mozconfig.
2014-07-03 02:15:31 +04:00
|
|
|
])
|