Fixing internal MOZ_TWO_STRINGS_TEST macro so that it doesn't always use enableval to test option arguments

Bug #107055 r=jesup
This commit is contained in:
seawood%netscape.com 2001-10-29 22:59:31 +00:00
Родитель 7923c2f2fa
Коммит aa0a1f2c8a
2 изменённых файлов: 31 добавлений и 31 удалений

Просмотреть файл

@ -38,28 +38,28 @@ dnl MOZ_CHECK_PTHREADS( NAME, IF-YES [, ELSE ])
dnl MOZ_READ_MYCONFIG() - Read in 'myconfig.sh' file
dnl MOZ_TWO_STRING_TEST(NAME, STR1, IF-STR1, STR2, IF-STR2 [, ELSE])
dnl MOZ_TWO_STRING_TEST(NAME, VAL, STR1, IF-STR1, STR2, IF-STR2 [, ELSE])
AC_DEFUN(MOZ_TWO_STRING_TEST,
[if test "$enableval" = "[$2]"; then
ifelse([$3], , :, [$3])
elif test "$enableval" = "[$4]"; then
ifelse([$5], , :, [$5])
[if test "[$2]" = "[$3]"; then
ifelse([$4], , :, [$4])
elif test "[$2]" = "[$5]"; then
ifelse([$6], , :, [$6])
else
ifelse([$6], ,
[AC_MSG_ERROR([Option, [$1], does not take an argument ($enableval).])],
[$6])
ifelse([$7], ,
[AC_MSG_ERROR([Option, [$1], does not take an argument ([$2]).])],
[$7])
fi])
dnl MOZ_ARG_ENABLE_BOOL(NAME, HELP, IF-YES [, IF-NO [, ELSE]])
AC_DEFUN(MOZ_ARG_ENABLE_BOOL,
[AC_ARG_ENABLE([$1], [$2],
[MOZ_TWO_STRING_TEST([$1], yes, [$3], no, [$4])],
[MOZ_TWO_STRING_TEST([$1], [$enableval], yes, [$3], no, [$4])],
[$5])])
dnl MOZ_ARG_DISABLE_BOOL(NAME, HELP, IF-NO [, IF-YES [, ELSE]])
AC_DEFUN(MOZ_ARG_DISABLE_BOOL,
[AC_ARG_ENABLE([$1], [$2],
[MOZ_TWO_STRING_TEST([$1], no, [$3], yes, [$4])],
[MOZ_TWO_STRING_TEST([$1], [$enableval], no, [$3], yes, [$4])],
[$5])])
dnl MOZ_ARG_ENABLE_STRING(NAME, HELP, IF-SET [, ELSE])
@ -73,19 +73,19 @@ AC_DEFUN(MOZ_ARG_ENABLE_BOOL_OR_STRING,
])
m4exit(1)],
[AC_ARG_ENABLE([$1], [$2],
[MOZ_TWO_STRING_TEST([$1], yes, [$3], no, [$4], [$5])],
[MOZ_TWO_STRING_TEST([$1], [$enableval], yes, [$3], no, [$4], [$5])],
[$6])])])
dnl MOZ_ARG_WITH_BOOL(NAME, HELP, IF-YES [, IF-NO [, ELSE])
AC_DEFUN(MOZ_ARG_WITH_BOOL,
[AC_ARG_WITH([$1], [$2],
[MOZ_TWO_STRING_TEST([$1], yes, [$3], no, [$4])],
[MOZ_TWO_STRING_TEST([$1], [$withval], yes, [$3], no, [$4])],
[$5])])
dnl MOZ_ARG_WITHOUT_BOOL(NAME, HELP, IF-NO [, IF-YES [, ELSE])
AC_DEFUN(MOZ_ARG_WITHOUT_BOOL,
[AC_ARG_WITH([$1], [$2],
[MOZ_TWO_STRING_TEST([$1], no, [$3], yes, [$4])],
[MOZ_TWO_STRING_TEST([$1], [$withval], no, [$3], yes, [$4])],
[$5])])
dnl MOZ_ARG_WITH_STRING(NAME, HELP, IF-SET [, ELSE])

36
configure поставляемый
Просмотреть файл

@ -6954,16 +6954,16 @@ echo "
# Check whether --with-pthreads or --without-pthreads was given.
if test "${with_pthreads+set}" = set; then
withval="$with_pthreads"
if test "$enableval" = "yes"; then
if test "$withval" = "yes"; then
if test "$USE_PTHREADS"x = x; then
{ echo "configure: error: --with-pthreads specified for a system without pthread support " 1>&2; exit 1; };
fi
elif test "$enableval" = "no"; then
elif test "$withval" = "no"; then
USE_PTHREADS=
_PTHREAD_LDFLAGS=
else
{ echo "configure: error: Option, pthreads, does not take an argument ($enableval)." 1>&2; exit 1; }
{ echo "configure: error: Option, pthreads, does not take an argument ($withval)." 1>&2; exit 1; }
fi
fi
@ -8235,12 +8235,12 @@ fi
# Check whether --with-system-nspr or --without-system-nspr was given.
if test "${with_system_nspr+set}" = set; then
withval="$with_system_nspr"
if test "$enableval" = "no"; then
if test "$withval" = "no"; then
_NO_NSPR=1
elif test "$enableval" = "yes"; then
elif test "$withval" = "yes"; then
:
else
{ echo "configure: error: Option, system-nspr, does not take an argument ($enableval)." 1>&2; exit 1; }
{ echo "configure: error: Option, system-nspr, does not take an argument ($withval)." 1>&2; exit 1; }
fi
fi
@ -9209,12 +9209,12 @@ fi
# Check whether --with-static-gtk or --without-static-gtk was given.
if test "${with_static_gtk+set}" = set; then
withval="$with_static_gtk"
if test "$enableval" = "yes"; then
if test "$withval" = "yes"; then
sysstaticgtk=$enableval
elif test "$enableval" = "no"; then
elif test "$withval" = "no"; then
:
else
{ echo "configure: error: Option, static-gtk, does not take an argument ($enableval)." 1>&2; exit 1; }
{ echo "configure: error: Option, static-gtk, does not take an argument ($withval)." 1>&2; exit 1; }
fi
fi
@ -9419,12 +9419,12 @@ test -n "$HOST_MOC" || HOST_MOC=""""
# Check whether --with-static-qt or --without-static-qt was given.
if test "${with_static_qt+set}" = set; then
withval="$with_static_qt"
if test "$enableval" = "yes"; then
if test "$withval" = "yes"; then
sysstaticqt=$withval
elif test "$enableval" = "no"; then
elif test "$withval" = "no"; then
:
else
{ echo "configure: error: Option, static-qt, does not take an argument ($enableval)." 1>&2; exit 1; }
{ echo "configure: error: Option, static-qt, does not take an argument ($withval)." 1>&2; exit 1; }
fi
fi
@ -11045,16 +11045,16 @@ fi
# Check whether --with-os2vacpp or --without-os2vacpp was given.
if test "${with_os2vacpp+set}" = set; then
withval="$with_os2vacpp"
if test "$enableval" = "yes"; then
if test "$withval" = "yes"; then
MOZ_OS2_TOOLS=VACPP
cat >> confdefs.h <<\EOF
#define XP_OS2_VACPP 1
EOF
elif test "$enableval" = "no"; then
elif test "$withval" = "no"; then
:
else
{ echo "configure: error: Option, os2vacpp, does not take an argument ($enableval)." 1>&2; exit 1; }
{ echo "configure: error: Option, os2vacpp, does not take an argument ($withval)." 1>&2; exit 1; }
fi
fi
@ -11266,12 +11266,12 @@ SKIP_IDL_CHECK="no"
# Check whether --with-libIDL or --without-libIDL was given.
if test "${with_libIDL+set}" = set; then
withval="$with_libIDL"
if test "$enableval" = "no"; then
if test "$withval" = "no"; then
SKIP_IDL_CHECK="yes"
elif test "$enableval" = "yes"; then
elif test "$withval" = "yes"; then
:
else
{ echo "configure: error: Option, libIDL, does not take an argument ($enableval)." 1>&2; exit 1; }
{ echo "configure: error: Option, libIDL, does not take an argument ($withval)." 1>&2; exit 1; }
fi
fi