-
-
Notifications
You must be signed in to change notification settings - Fork 33.9k
gh-142379: configure.ac: detect unusable termio operations #142380
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| Some termio operations are not actually usable on some | ||
| architectures. For example, the TCGETA, TCSETA, TCSETAF and TCSETAW | ||
| are defined with a reference to "struct termio" on alpha, hppa and | ||
| sparc64, but "struct termio" is no longer defined since glibc 2.42, | ||
| causing a build failure. | ||
|
|
||
| Instead of using those operations as soon as they are defined, check | ||
| more carefully that they are actually usable. This is done using a new | ||
| m4 macro PY_CHECK_CONSTANT. | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -95,6 +95,18 @@ AC_DEFUN([PY_CHECK_EMSCRIPTEN_PORT], [ | |||||||
| AS_VAR_POPDEF([py_libs]) | ||||||||
| ]) | ||||||||
|
|
||||||||
| dnl PY_CHECK_CONSTANT(TYPE, CONSTANT, [INCLUDES]) | ||||||||
| dnl Checks whether the constant exists and is actually usable (unlike | ||||||||
| dnl AC_CHECK_DECL that only checks if the constant exists) | ||||||||
| AC_DEFUN([PY_CHECK_CONSTANT], [ | ||||||||
| AC_MSG_CHECKING([for $2]) | ||||||||
| AC_COMPILE_IFELSE([AC_LANG_PROGRAM([$3], [[$1 val = $2;]])], | ||||||||
| [AC_MSG_RESULT([yes]) | ||||||||
| AC_DEFINE([HAVE_$2], [1], | ||||||||
| [Defined if $2 is usable])], | ||||||||
|
Comment on lines
+105
to
+106
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
(Sorry, but I really want to avoid vertically expanding our configure.ac as much as possible; ideally we should have all "functions" in a separate file but we don't do that...) |
||||||||
| [AC_MSG_RESULT([no])] | ||||||||
| )]) | ||||||||
|
|
||||||||
| AC_SUBST([BASECPPFLAGS]) | ||||||||
| if test "$srcdir" != . -a "$srcdir" != "$(pwd)"; then | ||||||||
| # If we're building out-of-tree, we need to make sure the following | ||||||||
|
|
@@ -8245,6 +8257,12 @@ AC_SUBST([JIT_STENCILS_H]) | |||||||
| # substitute multiline block, must come after last PY_STDLIB_MOD() | ||||||||
| AC_SUBST([MODULE_BLOCK]) | ||||||||
|
|
||||||||
| # gh-142379: ioctls used by Modules/termios.c but not usable on all platforms | ||||||||
| PY_CHECK_CONSTANT([long], [TCGETA], [#include <sys/ioctl.h>]) | ||||||||
| PY_CHECK_CONSTANT([long], [TCSETA], [#include <sys/ioctl.h>]) | ||||||||
| PY_CHECK_CONSTANT([long], [TCSETAF], [#include <sys/ioctl.h>]) | ||||||||
| PY_CHECK_CONSTANT([long], [TCSETAW], [#include <sys/ioctl.h>]) | ||||||||
|
|
||||||||
| # generate output files | ||||||||
| AC_CONFIG_FILES(m4_normalize([ | ||||||||
| Makefile.pre | ||||||||
|
|
||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is the NEWS entry still long? I think you overwrote your change.