Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions Modules/posixmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,17 @@ disguised Unix interface). Refer to the library manual and\n\
corresponding Unix manual entries for more information on calls.");


#if defined(MAJOR_IN_MKDEV)
#include <sys/mkdev.h>
#else
#if defined(MAJOR_IN_SYSMACROS)
#include <sys/sysmacros.h>
#endif
#if defined(HAVE_MKNOD) && defined(HAVE_SYS_MKDEV_H)
#include <sys/mkdev.h>
#endif
#endif

#ifdef HAVE_SYS_UIO_H
#include <sys/uio.h>
#endif
Expand Down Expand Up @@ -373,17 +384,6 @@ static int win32_can_symlink = 0;
# define STRUCT_STAT struct stat
#endif

#if defined(MAJOR_IN_MKDEV)
#include <sys/mkdev.h>
#else
#if defined(MAJOR_IN_SYSMACROS)
#include <sys/sysmacros.h>
#endif
#if defined(HAVE_MKNOD) && defined(HAVE_SYS_MKDEV_H)
#include <sys/mkdev.h>
#endif
#endif

#define DWORD_MAX 4294967295U

#ifdef MS_WINDOWS
Expand Down
2 changes: 1 addition & 1 deletion aclocal.m4
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ if test $pkg_failed = yes; then
_PKG_SHORT_ERRORS_SUPPORTED
if test $_pkg_short_errors_supported = yes; then
$1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
else
else
$1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
fi
# Put the nasty error message in config.log where it belongs
Expand Down
63 changes: 34 additions & 29 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -622,6 +622,7 @@ ac_includes_default="\
# include <unistd.h>
#endif"

ac_header_list=
ac_subst_vars='LTLIBOBJS
ENSUREPIP
SRCDIRS
Expand Down Expand Up @@ -2609,6 +2610,7 @@ $as_echo "$as_me: creating cache $cache_file" >&6;}
>$cache_file
fi

as_fn_append ac_header_list " sys/types.h"
# Check that the precious variables saved in the cache have kept the same
# value.
ac_cache_corrupted=false
Expand Down Expand Up @@ -7994,35 +7996,40 @@ fi

fi

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether sys/types.h defines makedev" >&5
$as_echo_n "checking whether sys/types.h defines makedev... " >&6; }
if ${ac_cv_header_sys_types_h_makedev+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <sys/types.h>
int
main ()
{
return makedev(0, 0);
;
return 0;
}

# This works around a buggy version in autoconf <= 2.69.
# See <https://lists.gnu.org/archive/html/autoconf/2016-08/msg00014.html>



# This is taken from the following Autoconf patch:
# http://git.sv.gnu.org/cgit/autoconf.git/commit/?id=XXXXXXX









for ac_header in $ac_header_list
do :
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
"
if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
cat >>confdefs.h <<_ACEOF
#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_header_sys_types_h_makedev=yes
else
ac_cv_header_sys_types_h_makedev=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext

fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_sys_types_h_makedev" >&5
$as_echo "$ac_cv_header_sys_types_h_makedev" >&6; }

if test $ac_cv_header_sys_types_h_makedev = no; then
done




ac_fn_c_check_header_mongrel "$LINENO" "sys/mkdev.h" "ac_cv_header_sys_mkdev_h" "$ac_includes_default"
if test "x$ac_cv_header_sys_mkdev_h" = xyes; then :

Expand All @@ -8031,17 +8038,15 @@ $as_echo "#define MAJOR_IN_MKDEV 1" >>confdefs.h
fi



if test $ac_cv_header_sys_mkdev_h = no; then
ac_fn_c_check_header_mongrel "$LINENO" "sys/sysmacros.h" "ac_cv_header_sys_sysmacros_h" "$ac_includes_default"
if test $ac_cv_header_sys_mkdev_h = no; then
ac_fn_c_check_header_mongrel "$LINENO" "sys/sysmacros.h" "ac_cv_header_sys_sysmacros_h" "$ac_includes_default"
if test "x$ac_cv_header_sys_sysmacros_h" = xyes; then :

$as_echo "#define MAJOR_IN_SYSMACROS 1" >>confdefs.h

fi


fi
fi


Expand Down
26 changes: 26 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -2058,6 +2058,32 @@ libutil.h sys/resource.h netpacket/packet.h sysexits.h bluetooth.h \
linux/tipc.h linux/random.h spawn.h util.h alloca.h endian.h \
sys/endian.h)
AC_HEADER_DIRENT

# This works around a buggy version in autoconf <= 2.69.
# See <https://lists.gnu.org/archive/html/autoconf/2016-08/msg00014.html>

m4_version_prereq([2.70], [], [

# This is taken from the following Autoconf patch:
# http://git.sv.gnu.org/cgit/autoconf.git/commit/?id=XXXXXXX
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

XXXXXXX doesn't seem to be a correct Git sha1 :-)


m4_undefine([AC_HEADER_MAJOR])
AC_DEFUN([AC_HEADER_MAJOR],
[AC_CHECK_HEADERS_ONCE([sys/types.h])
AC_CHECK_HEADER([sys/mkdev.h],
[AC_DEFINE([MAJOR_IN_MKDEV], [1],
[Define to 1 if `major', `minor', and `makedev' are declared in
<mkdev.h>.])])
if test $ac_cv_header_sys_mkdev_h = no; then
AC_CHECK_HEADER([sys/sysmacros.h],
[AC_DEFINE([MAJOR_IN_SYSMACROS], [1],
[Define to 1 if `major', `minor', and `makedev' are declared in
<sysmacros.h>.])])
fi
])

])

AC_HEADER_MAJOR

# bluetooth/bluetooth.h has been known to not compile with -std=c99.
Expand Down