mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
- Issue #14324: Fix configure tests for cross builds.
when configured --with(out)-computed-gotos for a cross, use this value instead of defaulting to no.
This commit is contained in:
parent
3b739b149b
commit
b17289e199
2 changed files with 73 additions and 67 deletions
51
configure.ac
51
configure.ac
|
@ -4239,30 +4239,6 @@ then
|
|||
wide chars that would be converted.])
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING(whether $CC supports computed gotos)
|
||||
AC_CACHE_VAL(ac_cv_computed_gotos,
|
||||
AC_RUN_IFELSE([AC_LANG_SOURCE([[[
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
static void *targets[1] = { &&LABEL1 };
|
||||
goto LABEL2;
|
||||
LABEL1:
|
||||
return 0;
|
||||
LABEL2:
|
||||
goto *targets[0];
|
||||
return 1;
|
||||
}
|
||||
]]])],
|
||||
[ac_cv_computed_gotos=yes],
|
||||
[ac_cv_computed_gotos=no],
|
||||
[ac_cv_computed_gotos=no]))
|
||||
AC_MSG_RESULT($ac_cv_computed_gotos)
|
||||
if test "$ac_cv_computed_gotos" = yes
|
||||
then
|
||||
AC_DEFINE(HAVE_COMPUTED_GOTOS, 1,
|
||||
[Define if the C compiler supports computed gotos.])
|
||||
fi
|
||||
|
||||
# Check for --with-computed-gotos
|
||||
AC_MSG_CHECKING(for --with-computed-gotos)
|
||||
AC_ARG_WITH(computed-gotos,
|
||||
|
@ -4284,6 +4260,33 @@ fi
|
|||
],
|
||||
[AC_MSG_RESULT(no value specified)])
|
||||
|
||||
AC_MSG_CHECKING(whether $CC supports computed gotos)
|
||||
AC_CACHE_VAL(ac_cv_computed_gotos,
|
||||
AC_RUN_IFELSE([AC_LANG_SOURCE([[[
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
static void *targets[1] = { &&LABEL1 };
|
||||
goto LABEL2;
|
||||
LABEL1:
|
||||
return 0;
|
||||
LABEL2:
|
||||
goto *targets[0];
|
||||
return 1;
|
||||
}
|
||||
]]])],
|
||||
[ac_cv_computed_gotos=yes],
|
||||
[ac_cv_computed_gotos=no],
|
||||
[if test "${with_computed_gotos+set}" = set; then
|
||||
ac_cv_computed_gotos="$with_computed_gotos -- configured --with(out)-computed-gotos"
|
||||
else
|
||||
ac_cv_computed_gotos=no
|
||||
fi]))
|
||||
AC_MSG_RESULT($ac_cv_computed_gotos)
|
||||
case "$ac_cv_computed_gotos" in yes*)
|
||||
AC_DEFINE(HAVE_COMPUTED_GOTOS, 1,
|
||||
[Define if the C compiler supports computed gotos.])
|
||||
esac
|
||||
|
||||
case $ac_sys_system in
|
||||
AIX*)
|
||||
AC_DEFINE(HAVE_BROKEN_PIPE_BUF, 1, [Define if the system reports an invalid PIPE_BUF value.]) ;;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue