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

Skip to content

Commit b457b9b

Browse files
committed
- Issue #3754: Fix /dev/ptmx, /dev/ptc file checks for cross builds,
require values set in CONFIG_SITE.
1 parent 536f1b9 commit b457b9b

3 files changed

Lines changed: 77 additions & 33 deletions

File tree

configure

Lines changed: 54 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14452,34 +14452,73 @@ $as_echo "no" >&6; }
1445214452
fi
1445314453
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
1445414454

14455+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for device files" >&5
14456+
$as_echo "$as_me: checking for device files" >&6;}
14457+
14458+
if test "x$cross_compiling" = xyes; then
14459+
if test "${ac_cv_file__dev_ptmx+set}" != set; then
14460+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for /dev/ptmx" >&5
14461+
$as_echo_n "checking for /dev/ptmx... " >&6; }
14462+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: not set" >&5
14463+
$as_echo "not set" >&6; }
14464+
as_fn_error $? "set ac_cv_file__dev_ptmx to yes/no in your CONFIG_SITE file when cross compiling" "$LINENO" 5
14465+
fi
14466+
if test "${ac_cv_file__dev_ptc+set}" != set; then
14467+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for /dev/ptc" >&5
14468+
$as_echo_n "checking for /dev/ptc... " >&6; }
14469+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: not set" >&5
14470+
$as_echo "not set" >&6; }
14471+
as_fn_error $? "set ac_cv_file__dev_ptc to yes/no in your CONFIG_SITE file when cross compiling" "$LINENO" 5
14472+
fi
14473+
fi
14474+
1445514475
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for /dev/ptmx" >&5
1445614476
$as_echo_n "checking for /dev/ptmx... " >&6; }
14477+
if ${ac_cv_file__dev_ptmx+:} false; then :
14478+
$as_echo_n "(cached) " >&6
14479+
else
14480+
test "$cross_compiling" = yes &&
14481+
as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5
14482+
if test -r "/dev/ptmx"; then
14483+
ac_cv_file__dev_ptmx=yes
14484+
else
14485+
ac_cv_file__dev_ptmx=no
14486+
fi
14487+
fi
14488+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__dev_ptmx" >&5
14489+
$as_echo "$ac_cv_file__dev_ptmx" >&6; }
14490+
if test "x$ac_cv_file__dev_ptmx" = xyes; then :
1445714491

14458-
if test -r /dev/ptmx
14459-
then
14460-
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
14461-
$as_echo "yes" >&6; }
14492+
fi
14493+
14494+
if test "x$ac_cv_file__dev_ptmx" = xyes; then
1446214495

1446314496
$as_echo "#define HAVE_DEV_PTMX 1" >>confdefs.h
1446414497

14465-
else
14466-
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
14467-
$as_echo "no" >&6; }
1446814498
fi
14469-
1447014499
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for /dev/ptc" >&5
1447114500
$as_echo_n "checking for /dev/ptc... " >&6; }
14501+
if ${ac_cv_file__dev_ptc+:} false; then :
14502+
$as_echo_n "(cached) " >&6
14503+
else
14504+
test "$cross_compiling" = yes &&
14505+
as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5
14506+
if test -r "/dev/ptc"; then
14507+
ac_cv_file__dev_ptc=yes
14508+
else
14509+
ac_cv_file__dev_ptc=no
14510+
fi
14511+
fi
14512+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__dev_ptc" >&5
14513+
$as_echo "$ac_cv_file__dev_ptc" >&6; }
14514+
if test "x$ac_cv_file__dev_ptc" = xyes; then :
1447214515

14473-
if test -r /dev/ptc
14474-
then
14475-
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
14476-
$as_echo "yes" >&6; }
14516+
fi
14517+
14518+
if test "x$ac_cv_file__dev_ptc" = xyes; then
1447714519

1447814520
$as_echo "#define HAVE_DEV_PTC 1" >>confdefs.h
1447914521

14480-
else
14481-
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
14482-
$as_echo "no" >&6; }
1448314522
fi
1448414523

1448514524
if test "$have_long_long" = yes

configure.ac

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4212,26 +4212,31 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <curses.h>]], [[void *x=resizeterm
42124212
[AC_MSG_RESULT(no)]
42134213
)
42144214

4215-
AC_MSG_CHECKING(for /dev/ptmx)
4215+
AC_MSG_NOTICE([checking for device files])
4216+
4217+
dnl NOTE: Inform user how to proceed with files when cross compiling.
4218+
if test "x$cross_compiling" = xyes; then
4219+
if test "${ac_cv_file__dev_ptmx+set}" != set; then
4220+
AC_MSG_CHECKING([for /dev/ptmx])
4221+
AC_MSG_RESULT([not set])
4222+
AC_MSG_ERROR([set ac_cv_file__dev_ptmx to yes/no in your CONFIG_SITE file when cross compiling])
4223+
fi
4224+
if test "${ac_cv_file__dev_ptc+set}" != set; then
4225+
AC_MSG_CHECKING([for /dev/ptc])
4226+
AC_MSG_RESULT([not set])
4227+
AC_MSG_ERROR([set ac_cv_file__dev_ptc to yes/no in your CONFIG_SITE file when cross compiling])
4228+
fi
4229+
fi
42164230

4217-
if test -r /dev/ptmx
4218-
then
4219-
AC_MSG_RESULT(yes)
4231+
AC_CHECK_FILE(/dev/ptmx, [], [])
4232+
if test "x$ac_cv_file__dev_ptmx" = xyes; then
42204233
AC_DEFINE(HAVE_DEV_PTMX, 1,
4221-
[Define if we have /dev/ptmx.])
4222-
else
4223-
AC_MSG_RESULT(no)
4234+
[Define to 1 if you have the /dev/ptmx device file.])
42244235
fi
4225-
4226-
AC_MSG_CHECKING(for /dev/ptc)
4227-
4228-
if test -r /dev/ptc
4229-
then
4230-
AC_MSG_RESULT(yes)
4236+
AC_CHECK_FILE(/dev/ptc, [], [])
4237+
if test "x$ac_cv_file__dev_ptc" = xyes; then
42314238
AC_DEFINE(HAVE_DEV_PTC, 1,
4232-
[Define if we have /dev/ptc.])
4233-
else
4234-
AC_MSG_RESULT(no)
4239+
[Define to 1 if you have the /dev/ptc device file.])
42354240
fi
42364241

42374242
if test "$have_long_long" = yes

pyconfig.h.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,10 +168,10 @@
168168
/* Define to 1 if you have the device macros. */
169169
#undef HAVE_DEVICE_MACROS
170170

171-
/* Define if we have /dev/ptc. */
171+
/* Define to 1 if you have the /dev/ptc device file. */
172172
#undef HAVE_DEV_PTC
173173

174-
/* Define if we have /dev/ptmx. */
174+
/* Define to 1 if you have the /dev/ptmx device file. */
175175
#undef HAVE_DEV_PTMX
176176

177177
/* Define to 1 if you have the <direct.h> header file. */

0 commit comments

Comments
 (0)