Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b17289e

Browse files
committed
- 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.
1 parent 3b739b1 commit b17289e

2 files changed

Lines changed: 64 additions & 58 deletions

File tree

configure

Lines changed: 37 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -14022,13 +14022,47 @@ $as_echo "#define HAVE_BROKEN_MBSTOWCS 1" >>confdefs.h
1402214022

1402314023
fi
1402414024

14025+
# Check for --with-computed-gotos
14026+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-computed-gotos" >&5
14027+
$as_echo_n "checking for --with-computed-gotos... " >&6; }
14028+
14029+
# Check whether --with-computed-gotos was given.
14030+
if test "${with_computed_gotos+set}" = set; then :
14031+
withval=$with_computed_gotos;
14032+
if test "$withval" = yes
14033+
then
14034+
14035+
$as_echo "#define USE_COMPUTED_GOTOS 1" >>confdefs.h
14036+
14037+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
14038+
$as_echo "yes" >&6; }
14039+
fi
14040+
if test "$withval" = no
14041+
then
14042+
14043+
$as_echo "#define USE_COMPUTED_GOTOS 0" >>confdefs.h
14044+
14045+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
14046+
$as_echo "no" >&6; }
14047+
fi
14048+
14049+
else
14050+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no value specified" >&5
14051+
$as_echo "no value specified" >&6; }
14052+
fi
14053+
14054+
1402514055
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports computed gotos" >&5
1402614056
$as_echo_n "checking whether $CC supports computed gotos... " >&6; }
1402714057
if ${ac_cv_computed_gotos+:} false; then :
1402814058
$as_echo_n "(cached) " >&6
1402914059
else
1403014060
if test "$cross_compiling" = yes; then :
14031-
ac_cv_computed_gotos=no
14061+
if test "${with_computed_gotos+set}" = set; then
14062+
ac_cv_computed_gotos="$with_computed_gotos -- configured --with(out)-computed-gotos"
14063+
else
14064+
ac_cv_computed_gotos=no
14065+
fi
1403214066
else
1403314067
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1403414068
/* end confdefs.h. */
@@ -14058,42 +14092,11 @@ fi
1405814092

1405914093
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_computed_gotos" >&5
1406014094
$as_echo "$ac_cv_computed_gotos" >&6; }
14061-
if test "$ac_cv_computed_gotos" = yes
14062-
then
14095+
case "$ac_cv_computed_gotos" in yes*)
1406314096

1406414097
$as_echo "#define HAVE_COMPUTED_GOTOS 1" >>confdefs.h
1406514098

14066-
fi
14067-
14068-
# Check for --with-computed-gotos
14069-
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-computed-gotos" >&5
14070-
$as_echo_n "checking for --with-computed-gotos... " >&6; }
14071-
14072-
# Check whether --with-computed-gotos was given.
14073-
if test "${with_computed_gotos+set}" = set; then :
14074-
withval=$with_computed_gotos;
14075-
if test "$withval" = yes
14076-
then
14077-
14078-
$as_echo "#define USE_COMPUTED_GOTOS 1" >>confdefs.h
14079-
14080-
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
14081-
$as_echo "yes" >&6; }
14082-
fi
14083-
if test "$withval" = no
14084-
then
14085-
14086-
$as_echo "#define USE_COMPUTED_GOTOS 0" >>confdefs.h
14087-
14088-
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
14089-
$as_echo "no" >&6; }
14090-
fi
14091-
14092-
else
14093-
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no value specified" >&5
14094-
$as_echo "no value specified" >&6; }
14095-
fi
14096-
14099+
esac
1409714100

1409814101
case $ac_sys_system in
1409914102
AIX*)

configure.ac

Lines changed: 27 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -4239,30 +4239,6 @@ then
42394239
wide chars that would be converted.])
42404240
fi
42414241

4242-
AC_MSG_CHECKING(whether $CC supports computed gotos)
4243-
AC_CACHE_VAL(ac_cv_computed_gotos,
4244-
AC_RUN_IFELSE([AC_LANG_SOURCE([[[
4245-
int main(int argc, char **argv)
4246-
{
4247-
static void *targets[1] = { &&LABEL1 };
4248-
goto LABEL2;
4249-
LABEL1:
4250-
return 0;
4251-
LABEL2:
4252-
goto *targets[0];
4253-
return 1;
4254-
}
4255-
]]])],
4256-
[ac_cv_computed_gotos=yes],
4257-
[ac_cv_computed_gotos=no],
4258-
[ac_cv_computed_gotos=no]))
4259-
AC_MSG_RESULT($ac_cv_computed_gotos)
4260-
if test "$ac_cv_computed_gotos" = yes
4261-
then
4262-
AC_DEFINE(HAVE_COMPUTED_GOTOS, 1,
4263-
[Define if the C compiler supports computed gotos.])
4264-
fi
4265-
42664242
# Check for --with-computed-gotos
42674243
AC_MSG_CHECKING(for --with-computed-gotos)
42684244
AC_ARG_WITH(computed-gotos,
@@ -4284,6 +4260,33 @@ fi
42844260
],
42854261
[AC_MSG_RESULT(no value specified)])
42864262

4263+
AC_MSG_CHECKING(whether $CC supports computed gotos)
4264+
AC_CACHE_VAL(ac_cv_computed_gotos,
4265+
AC_RUN_IFELSE([AC_LANG_SOURCE([[[
4266+
int main(int argc, char **argv)
4267+
{
4268+
static void *targets[1] = { &&LABEL1 };
4269+
goto LABEL2;
4270+
LABEL1:
4271+
return 0;
4272+
LABEL2:
4273+
goto *targets[0];
4274+
return 1;
4275+
}
4276+
]]])],
4277+
[ac_cv_computed_gotos=yes],
4278+
[ac_cv_computed_gotos=no],
4279+
[if test "${with_computed_gotos+set}" = set; then
4280+
ac_cv_computed_gotos="$with_computed_gotos -- configured --with(out)-computed-gotos"
4281+
else
4282+
ac_cv_computed_gotos=no
4283+
fi]))
4284+
AC_MSG_RESULT($ac_cv_computed_gotos)
4285+
case "$ac_cv_computed_gotos" in yes*)
4286+
AC_DEFINE(HAVE_COMPUTED_GOTOS, 1,
4287+
[Define if the C compiler supports computed gotos.])
4288+
esac
4289+
42874290
case $ac_sys_system in
42884291
AIX*)
42894292
AC_DEFINE(HAVE_BROKEN_PIPE_BUF, 1, [Define if the system reports an invalid PIPE_BUF value.]) ;;

0 commit comments

Comments
 (0)