Skip to content

Commit fdd5e8e

Browse files
committed
bpo-31343: Include sys/sysmacros.h
Include sys/sysmacros.h for major(), minor(), and makedev(). GNU C libray plans to remove the functions from sys/types.h. Signed-off-by: Christian Heimes <[email protected]>
1 parent af64aff commit fdd5e8e

File tree

6 files changed

+84
-18
lines changed

6 files changed

+84
-18
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Include sys/sysmacros.h for major(), minor(), and makedev(). GNU C libray
2+
plans to remove the functions from sys/types.h.

Modules/posixmodule.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,11 @@ corresponding Unix manual entries for more information on calls.");
5656
#include <sys/uio.h>
5757
#endif
5858

59+
#ifdef HAVE_SYS_SYSMACROS_H
60+
/* GNU C Library: major(), minor(), makedev() */
61+
#include <sys/sysmacros.h>
62+
#endif
63+
5964
#ifdef HAVE_SYS_TYPES_H
6065
#include <sys/types.h>
6166
#endif /* HAVE_SYS_TYPES_H */

aclocal.m4

Lines changed: 71 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
# PARTICULAR PURPOSE.
1313

1414
m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
15-
dnl pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
16-
dnl serial 11 (pkg-config-0.29.1)
17-
dnl
15+
# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
16+
# serial 11 (pkg-config-0.29.1)
17+
1818
dnl Copyright © 2004 Scott James Remnant <[email protected]>.
1919
dnl Copyright © 2012-2015 Dan Nicholson <[email protected]>
2020
dnl
@@ -288,3 +288,71 @@ AS_VAR_COPY([$1], [pkg_cv_][$1])
288288
AS_VAR_IF([$1], [""], [$5], [$4])dnl
289289
])dnl PKG_CHECK_VAR
290290

291+
dnl PKG_WITH_MODULES(VARIABLE-PREFIX, MODULES,
292+
dnl [ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND],
293+
dnl [DESCRIPTION], [DEFAULT])
294+
dnl ------------------------------------------
295+
dnl
296+
dnl Prepare a "--with-" configure option using the lowercase
297+
dnl [VARIABLE-PREFIX] name, merging the behaviour of AC_ARG_WITH and
298+
dnl PKG_CHECK_MODULES in a single macro.
299+
AC_DEFUN([PKG_WITH_MODULES],
300+
[
301+
m4_pushdef([with_arg], m4_tolower([$1]))
302+
303+
m4_pushdef([description],
304+
[m4_default([$5], [build with ]with_arg[ support])])
305+
306+
m4_pushdef([def_arg], [m4_default([$6], [auto])])
307+
m4_pushdef([def_action_if_found], [AS_TR_SH([with_]with_arg)=yes])
308+
m4_pushdef([def_action_if_not_found], [AS_TR_SH([with_]with_arg)=no])
309+
310+
m4_case(def_arg,
311+
[yes],[m4_pushdef([with_without], [--without-]with_arg)],
312+
[m4_pushdef([with_without],[--with-]with_arg)])
313+
314+
AC_ARG_WITH(with_arg,
315+
AS_HELP_STRING(with_without, description[ @<:@default=]def_arg[@:>@]),,
316+
[AS_TR_SH([with_]with_arg)=def_arg])
317+
318+
AS_CASE([$AS_TR_SH([with_]with_arg)],
319+
[yes],[PKG_CHECK_MODULES([$1],[$2],$3,$4)],
320+
[auto],[PKG_CHECK_MODULES([$1],[$2],
321+
[m4_n([def_action_if_found]) $3],
322+
[m4_n([def_action_if_not_found]) $4])])
323+
324+
m4_popdef([with_arg])
325+
m4_popdef([description])
326+
m4_popdef([def_arg])
327+
328+
])dnl PKG_WITH_MODULES
329+
330+
dnl PKG_HAVE_WITH_MODULES(VARIABLE-PREFIX, MODULES,
331+
dnl [DESCRIPTION], [DEFAULT])
332+
dnl -----------------------------------------------
333+
dnl
334+
dnl Convenience macro to trigger AM_CONDITIONAL after PKG_WITH_MODULES
335+
dnl check._[VARIABLE-PREFIX] is exported as make variable.
336+
AC_DEFUN([PKG_HAVE_WITH_MODULES],
337+
[
338+
PKG_WITH_MODULES([$1],[$2],,,[$3],[$4])
339+
340+
AM_CONDITIONAL([HAVE_][$1],
341+
[test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"])
342+
])dnl PKG_HAVE_WITH_MODULES
343+
344+
dnl PKG_HAVE_DEFINE_WITH_MODULES(VARIABLE-PREFIX, MODULES,
345+
dnl [DESCRIPTION], [DEFAULT])
346+
dnl ------------------------------------------------------
347+
dnl
348+
dnl Convenience macro to run AM_CONDITIONAL and AC_DEFINE after
349+
dnl PKG_WITH_MODULES check. HAVE_[VARIABLE-PREFIX] is exported as make
350+
dnl and preprocessor variable.
351+
AC_DEFUN([PKG_HAVE_DEFINE_WITH_MODULES],
352+
[
353+
PKG_HAVE_WITH_MODULES([$1],[$2],[$3],[$4])
354+
355+
AS_IF([test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"],
356+
[AC_DEFINE([HAVE_][$1], 1, [Enable ]m4_tolower([$1])[ support])])
357+
])dnl PKG_HAVE_DEFINE_WITH_MODULES
358+

configure

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -782,7 +782,6 @@ infodir
782782
docdir
783783
oldincludedir
784784
includedir
785-
runstatedir
786785
localstatedir
787786
sharedstatedir
788787
sysconfdir
@@ -896,7 +895,6 @@ datadir='${datarootdir}'
896895
sysconfdir='${prefix}/etc'
897896
sharedstatedir='${prefix}/com'
898897
localstatedir='${prefix}/var'
899-
runstatedir='${localstatedir}/run'
900898
includedir='${prefix}/include'
901899
oldincludedir='/usr/include'
902900
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
@@ -1149,15 +1147,6 @@ do
11491147
| -silent | --silent | --silen | --sile | --sil)
11501148
silent=yes ;;
11511149

1152-
-runstatedir | --runstatedir | --runstatedi | --runstated \
1153-
| --runstate | --runstat | --runsta | --runst | --runs \
1154-
| --run | --ru | --r)
1155-
ac_prev=runstatedir ;;
1156-
-runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
1157-
| --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
1158-
| --run=* | --ru=* | --r=*)
1159-
runstatedir=$ac_optarg ;;
1160-
11611150
-sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
11621151
ac_prev=sbindir ;;
11631152
-sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
@@ -1295,7 +1284,7 @@ fi
12951284
for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
12961285
datadir sysconfdir sharedstatedir localstatedir includedir \
12971286
oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
1298-
libdir localedir mandir runstatedir
1287+
libdir localedir mandir
12991288
do
13001289
eval ac_val=\$$ac_var
13011290
# Remove trailing slashes.
@@ -1448,7 +1437,6 @@ Fine tuning of the installation directories:
14481437
--sysconfdir=DIR read-only single-machine data [PREFIX/etc]
14491438
--sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
14501439
--localstatedir=DIR modifiable single-machine data [PREFIX/var]
1451-
--runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
14521440
--libdir=DIR object code libraries [EPREFIX/lib]
14531441
--includedir=DIR C header files [PREFIX/include]
14541442
--oldincludedir=DIR C header files for non-gcc [/usr/include]
@@ -7818,7 +7806,7 @@ sys/stat.h sys/syscall.h sys/sys_domain.h sys/termio.h sys/time.h \
78187806
sys/times.h sys/types.h sys/uio.h sys/un.h sys/utsname.h sys/wait.h pty.h \
78197807
libutil.h sys/resource.h netpacket/packet.h sysexits.h bluetooth.h \
78207808
linux/tipc.h linux/random.h spawn.h util.h alloca.h endian.h \
7821-
sys/endian.h
7809+
sys/endian.h sys/sysmacros.h
78227810
do :
78237811
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
78247812
ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"

configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2065,7 +2065,7 @@ sys/stat.h sys/syscall.h sys/sys_domain.h sys/termio.h sys/time.h \
20652065
sys/times.h sys/types.h sys/uio.h sys/un.h sys/utsname.h sys/wait.h pty.h \
20662066
libutil.h sys/resource.h netpacket/packet.h sysexits.h bluetooth.h \
20672067
linux/tipc.h linux/random.h spawn.h util.h alloca.h endian.h \
2068-
sys/endian.h)
2068+
sys/endian.h sys/sysmacros.h)
20692069
AC_HEADER_DIRENT
20702070
AC_HEADER_MAJOR
20712071

pyconfig.h.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1054,6 +1054,9 @@
10541054
/* Define to 1 if you have the <sys/syscall.h> header file. */
10551055
#undef HAVE_SYS_SYSCALL_H
10561056

1057+
/* Define to 1 if you have the <sys/sysmacros.h> header file. */
1058+
#undef HAVE_SYS_SYSMACROS_H
1059+
10571060
/* Define to 1 if you have the <sys/sys_domain.h> header file. */
10581061
#undef HAVE_SYS_SYS_DOMAIN_H
10591062

0 commit comments

Comments
 (0)