From 998eeb82772fa999e975c5a8148734bbbaa85a54 Mon Sep 17 00:00:00 2001
From: midipix <writeonce@midipix.org>
Date: Fri, 14 Dec 2018 18:22:04 -0500
Subject: config & profiles: update to match Python-3.x's needs and
 definitions.

---
 profiles/osapi/linux.h          |  8 ++--
 profiles/osapi/modern.h         | 94 ++++++++++++++++++++++++++++++++++-------
 profiles/osapi/rtld.h           | 12 ++++++
 profiles/toolchain/64-default.h |  3 ++
 project/config/cfgdefs.sh       | 50 +++++++++++++++++++++-
 5 files changed, 146 insertions(+), 21 deletions(-)
 create mode 100644 profiles/osapi/rtld.h

diff --git a/profiles/osapi/linux.h b/profiles/osapi/linux.h
index 692bfac..29d6efc 100644
--- a/profiles/osapi/linux.h
+++ b/profiles/osapi/linux.h
@@ -6,12 +6,17 @@
 
 /* interfaces */
 #define HAVE_EPOLL                      1
+#define HAVE_LINUX_CAN_RAW_FD_FRAMES    1
 
 /* os-specific headers */
 #define HAVE_ASM_TYPES_H                1
 #define HAVE_ALLOCA_H                   1
 #define HAVE_DIRENT_H                   1
+#define HAVE_LINUX_CAN_BCM_H            1
+#define HAVE_LINUX_CAN_H                1
+#define HAVE_LINUX_CAN_RAW_H            1
 #define HAVE_LINUX_NETLINK_H            1
+#define HAVE_LINUX_RANDOM_H             1
 #define HAVE_LINUX_TIPC_H               1
 #define HAVE_NETPACKET_PACKET_H         1
 
@@ -24,7 +29,4 @@
 #define TANH_PRESERVES_ZERO_SIGN        1
 #define TIME_WITH_SYS_TIME              1
 
-/* compiler, toolchain, and abi */
-#define VA_LIST_IS_ARRAY                1
-
 #endif
diff --git a/profiles/osapi/modern.h b/profiles/osapi/modern.h
index c756844..32fc82a 100644
--- a/profiles/osapi/modern.h
+++ b/profiles/osapi/modern.h
@@ -49,17 +49,21 @@
 #define HAVE_UTIME_H                    1
 #define HAVE_WCHAR_H                    1
 
-
 /* interfaces */
+#define HAVE_ACCEPT4                    1
 #define HAVE_ACOSH                      1
 #define HAVE_ADDRINFO                   1
 #define HAVE_ALARM                      1
 #define HAVE_ASINH                      1
 #define HAVE_ATANH                      1
 #define HAVE_BIND_TEXTDOMAIN_CODESET    1
+#define HAVE_BUILTIN_ATOMIC             1
 #define HAVE_CHOWN                      1
 #define HAVE_CHROOT                     1
 #define HAVE_CLOCK                      1
+#define HAVE_CLOCK_GETRES               1
+#define HAVE_CLOCK_GETTIME              1
+#define HAVE_CLOCK_SETTIME              1
 #define HAVE_CONFSTR                    1
 #define HAVE_COPYSIGN                   1
 #define HAVE_CTERMID                    1
@@ -71,32 +75,44 @@
 #define HAVE_DECL_ISNAN                 1
 #define HAVE_DEVICE_MACROS              1
 #define HAVE_DEV_PTMX                   1
+#define HAVE_DIRENT_D_TYPE              1
+#define HAVE_DIRFD                      1
 #define HAVE_DLOPEN                     1
 #define HAVE_DUP2                       1
+#define HAVE_DUP3                       1
 #define HAVE_ERF                        1
 #define HAVE_ERFC                       1
 #define HAVE_EXECV                      1
 #define HAVE_EXPM1                      1
+#define HAVE_FACCESSAT                  1
 #define HAVE_FCHDIR                     1
 #define HAVE_FCHMOD                     1
+#define HAVE_FCHMODAT                   1
 #define HAVE_FCHOWN                     1
+#define HAVE_FCHOWNAT                   1
 #define HAVE_FDATASYNC                  1
+#define HAVE_FDOPENDIR                  1
+#define HAVE_FEXECVE                    1
 #define HAVE_FINITE                     1
 #define HAVE_FLOCK                      1
 #define HAVE_FORK                       1
 #define HAVE_FORKPTY                    1
 #define HAVE_FPATHCONF                  1
 #define HAVE_FSEEKO                     1
+#define HAVE_FSTATAT                    1
 #define HAVE_FSTATVFS                   1
 #define HAVE_FSYNC                      1
 #define HAVE_FTELLO                     1
 #define HAVE_FTIME                      1
 #define HAVE_FTRUNCATE                  1
+#define HAVE_FUTIMENS                   1
+#define HAVE_FUTIMES                    1
+#define HAVE_FUTIMESAT                  1
 #define HAVE_GAI_STRERROR               1
-#define HAVE_GCC_ASM_FOR_X87            1
 #define HAVE_GETADDRINFO                1
 #define HAVE_GETCWD                     1
 #define HAVE_GETC_UNLOCKED              1
+#define HAVE_GETGROUPLIST               1
 #define HAVE_GETGROUPS                  1
 #define HAVE_GETHOSTBYNAME_R            1
 #define HAVE_GETHOSTBYNAME_R_6_ARG      1
@@ -111,6 +127,7 @@
 #define HAVE_GETPID                     1
 #define HAVE_GETPRIORITY                1
 #define HAVE_GETPWENT                   1
+#define HAVE_GETRANDOM_SYSCALL          1
 #define HAVE_GETRESGID                  1
 #define HAVE_GETRESUID                  1
 #define HAVE_GETSID                     1
@@ -118,7 +135,9 @@
 #define HAVE_GETSPNAM                   1
 #define HAVE_GETTIMEOFDAY               1
 #define HAVE_HSTRERROR                  1
+#define HAVE_HTOLE64                    1
 #define HAVE_HYPOT                      1
+#define HAVE_IF_NAMEINDEX               1
 #define HAVE_INET_ATON                  1
 #define HAVE_INET_PTON                  1
 #define HAVE_INITGROUPS                 1
@@ -130,36 +149,46 @@
 #define HAVE_LIBDL                      1
 #define HAVE_LIBREADLINE                1
 #define HAVE_LINK                       1
+#define HAVE_LINKAT                     1
+#define HAVE_LOCKF                      1
 #define HAVE_LOG1P                      1
+#define HAVE_LOG2                       1
 #define HAVE_LSTAT                      1
+#define HAVE_LUTIMES                    1
 #define HAVE_MAKEDEV                    1
+#define HAVE_MBRTOWC                    1
 #define HAVE_MEMMOVE                    1
+#define HAVE_MEMRCHR                    1
+#define HAVE_MKDIRAT                    1
 #define HAVE_MKFIFO                     1
+#define HAVE_MKFIFOAT                   1
 #define HAVE_MKNOD                      1
+#define HAVE_MKNODAT                    1
 #define HAVE_MKTIME                     1
 #define HAVE_MMAP                       1
 #define HAVE_MREMAP                     1
 #define HAVE_NICE                       1
+#define HAVE_OPENAT                     1
 #define HAVE_OPENPTY                    1
 #define HAVE_PATHCONF                   1
 #define HAVE_PAUSE                      1
+#define HAVE_PIPE2                      1
 #define HAVE_POLL                       1
+#define HAVE_POSIX_FADVISE              1
+#define HAVE_POSIX_FALLOCATE            1
+#define HAVE_PREAD                      1
+#define HAVE_PRLIMIT                    1
 #define HAVE_PROTOTYPES                 1
 #define HAVE_PTHREAD_ATFORK             1
+#define HAVE_PTHREAD_KILL               1
 #define HAVE_PTHREAD_SIGMASK            1
 #define HAVE_PUTENV                     1
+#define HAVE_PWRITE                     1
 #define HAVE_READLINK                   1
+#define HAVE_READLINKAT                 1
+#define HAVE_READV                      1
 #define HAVE_REALPATH                   1
-#define HAVE_RL_CALLBACK                1
-#define HAVE_RL_CATCH_SIGNAL            1
-
-#define HAVE_RL_COMPLETION_APPEND_CHARACTER     1
-#define HAVE_RL_COMPLETION_DISPLAY_MATCHES_HOOK 1
-#define HAVE_RL_COMPLETION_MATCHES              1
-#define HAVE_RL_COMPLETION_SUPPRESS_APPEND      1
-
-#define HAVE_RL_PRE_INPUT_HOOK          1
-#define HAVE_RL_RESIZE_TERMINAL         1
+#define HAVE_RENAMEAT                   1
 #define HAVE_ROUND                      1
 #define HAVE_SELECT                     1
 #define HAVE_SEM_GETVALUE               1
@@ -170,10 +199,12 @@
 #define HAVE_SETEUID                    1
 #define HAVE_SETGID                     1
 #define HAVE_SETGROUPS                  1
+#define HAVE_SETHOSTNAME                1
 #define HAVE_SETITIMER                  1
 #define HAVE_SETLOCALE                  1
 #define HAVE_SETPGID                    1
 #define HAVE_SETPGRP                    1
+#define HAVE_SETPRIORITY                1
 #define HAVE_SETREGID                   1
 #define HAVE_SETRESGID                  1
 #define HAVE_SETRESUID                  1
@@ -182,21 +213,33 @@
 #define HAVE_SETUID                     1
 #define HAVE_SETVBUF                    1
 #define HAVE_SIGACTION                  1
+#define HAVE_SIGALTSTACK                1
 #define HAVE_SIGINTERRUPT               1
+#define HAVE_SIGPENDING                 1
 #define HAVE_SIGRELSE                   1
+#define HAVE_SIGTIMEDWAIT               1
+#define HAVE_SIGWAIT                    1
+#define HAVE_SIGWAITINFO                1
 #define HAVE_SNPRINTF                   1
+#define HAVE_SOCKADDR_ALG               1
 #define HAVE_SOCKADDR_STORAGE           1
 #define HAVE_SOCKETPAIR                 1
 #define HAVE_STATVFS                    1
 #define HAVE_STAT_TV_NSEC               1
 #define HAVE_STDARG_PROTOTYPES          1
+#define HAVE_STD_ATOMIC                 1
 #define HAVE_STRDUP                     1
 #define HAVE_STRFTIME                   1
+#define HAVE_STRLCPY                    1
+#define HAVE_STRUCT_PASSWD_PW_GECOS     1
+#define HAVE_STRUCT_PASSWD_PW_PASSWD    1
 #define HAVE_STRUCT_STAT_ST_BLKSIZE     1
 #define HAVE_STRUCT_STAT_ST_BLOCKS      1
 #define HAVE_STRUCT_STAT_ST_RDEV        1
 #define HAVE_STRUCT_TM_TM_ZONE          1
 #define HAVE_SYMLINK                    1
+#define HAVE_SYMLINKAT                  1
+#define HAVE_SYNC                       1
 #define HAVE_SYSCONF                    1
 #define HAVE_TCGETPGRP                  1
 #define HAVE_TCSETPGRP                  1
@@ -209,27 +252,46 @@
 #define HAVE_TM_ZONE                    1
 #define HAVE_TRUNCATE                   1
 #define HAVE_UNAME                      1
+#define HAVE_UNLINKAT                   1
 #define HAVE_UNSETENV                   1
+#define HAVE_UTIMENSAT                  1
 #define HAVE_UTIMES                     1
 #define HAVE_WAIT3                      1
 #define HAVE_WAIT4                      1
+#define HAVE_WAITID                     1
 #define HAVE_WAITPID                    1
 #define HAVE_WCSCOLL                    1
+#define HAVE_WCSFTIME                   1
+#define HAVE_WCSXFRM                    1
+#define HAVE_WMEMCMP                    1
 #define HAVE_WORKING_TZSET              1
+#define HAVE_WRITEV                     1
 #define HAVE_ZLIB_COPY                  1
 #define MVWDELCH_IS_EXPRESSION          1
 #define PTHREAD_SYSTEM_SCHED_SUPPORTED  1
+#define USE_INLINE                      1
+
+/* readline */
+#define HAVE_RL_APPEND_HISTORY                  1
+#define HAVE_RL_CALLBACK                        1
+#define HAVE_RL_CATCH_SIGNAL                    1
+#define HAVE_RL_COMPLETION_APPEND_CHARACTER     1
+#define HAVE_RL_COMPLETION_DISPLAY_MATCHES_HOOK 1
+#define HAVE_RL_COMPLETION_MATCHES              1
+#define HAVE_RL_COMPLETION_SUPPRESS_APPEND      1
+#define HAVE_RL_PRE_INPUT_HOOK                  1
+#define HAVE_RL_RESIZE_TERMINAL                 1
 
 /* python */
 #define PY_FORMAT_LONG_LONG             "ll"
 #define PY_FORMAT_SIZE_T                "z"
 
 #define Py_ENABLE_SHARED                1
-#define Py_UNICODE_SIZE                 4
-#define Py_USING_UNICODE                1
 
 
 /* compiler, toolchain, and framework */
+#define HAVE_GCC_UINT128_T              1
+
 #define HAVE_INT32_T                    1
 #define HAVE_INT64_T                    1
 #define HAVE_LONG_DOUBLE                1
@@ -280,9 +342,9 @@
 #define _GNU_SOURCE                     1
 #define _LARGEFILE_SOURCE               1
 #define _NETBSD_SOURCE                  1
-#define _POSIX_C_SOURCE                 200112L
+#define _POSIX_C_SOURCE                 200809L
 #define _REENTRANT                      1
-#define _XOPEN_SOURCE                   600
+#define _XOPEN_SOURCE                   700
 #define _XOPEN_SOURCE_EXTENDED          1
 #define __BSD_VISIBLE                   1
 #define __EXTENSIONS__                  1
diff --git a/profiles/osapi/rtld.h b/profiles/osapi/rtld.h
new file mode 100644
index 0000000..b3cab7e
--- /dev/null
+++ b/profiles/osapi/rtld.h
@@ -0,0 +1,12 @@
+#ifndef PY_OSAPI_RTLD_H
+#define PY_OSAPI_RTLD_H
+
+#define HAVE_DECL_RTLD_DEEPBIND         0
+#define HAVE_DECL_RTLD_GLOBAL           1
+#define HAVE_DECL_RTLD_LAZY             1
+#define HAVE_DECL_RTLD_LOCAL            1
+#define HAVE_DECL_RTLD_NODELETE         1
+#define HAVE_DECL_RTLD_NOLOAD           1
+#define HAVE_DECL_RTLD_NOW              1
+
+#endif
diff --git a/profiles/toolchain/64-default.h b/profiles/toolchain/64-default.h
index 957f6dd..5bc7057 100644
--- a/profiles/toolchain/64-default.h
+++ b/profiles/toolchain/64-default.h
@@ -19,4 +19,7 @@
 #define SIZEOF_WCHAR_T                  4
 #define SIZEOF__BOOL                    1
 
+#define HAVE_GCC_ASM_FOR_X87            1
+#define HAVE_GCC_ASM_FOR_X64            1
+
 #endif
diff --git a/project/config/cfgdefs.sh b/project/config/cfgdefs.sh
index 3b6a806..054e536 100644
--- a/project/config/cfgdefs.sh
+++ b/project/config/cfgdefs.sh
@@ -41,7 +41,30 @@ cfgdefs_perform_target_tests()
 	cfgtest_target_section
 
 	# headers
-	cfgtest_header_absence 'stropts.h'
+	cfgtest_header_absence  'stropts.h'
+	cfgtest_header_presence 'endian.h'
+	cfgtest_header_presence 'net/if.h'
+	cfgtest_header_presence 'sched.h'
+	cfgtest_header_presence 'sys/ioctl.h'
+	cfgtest_header_presence 'sys/sendfile.h'
+	cfgtest_header_presence 'sys/syscall.h'
+	cfgtest_header_presence 'sys/sysmacros.h'
+	cfgtest_header_presence 'sys/uio.h'
+	cfgtest_header_presence 'sys/xattr.h'
+
+	# interfaces
+	mb_cfgtest_headers='sys/epoll.h'
+	cfgtest_interface_presence 'epoll_create1'
+
+	mb_cfgtest_headers='sched.h'
+	cfgtest_interface_presence 'sched_get_priority_max'
+	cfgtest_interface_presence 'sched_rr_get_interval'
+	cfgtest_interface_presence 'sched_setaffinity'
+	cfgtest_interface_presence 'sched_setparam'
+	cfgtest_interface_presence 'sched_setscheduler'
+
+	mb_cfgtest_headers='sys/sendfile.h'
+	cfgtest_interface_presence 'sendfile'
 
 	# openssl
 	mb_cfgtest_headers='openssl/x509.h'
@@ -73,7 +96,30 @@ cfgdefs_perform_native_tests()
 	cfgtest_native_section
 
 	# headers
-	cfgtest_header_absence 'stropts.h'
+	cfgtest_header_absence  'stropts.h'
+	cfgtest_header_presence 'endian.h'
+	cfgtest_header_presence 'net/if.h'
+	cfgtest_header_presence 'sched.h'
+	cfgtest_header_presence 'sys/ioctl.h'
+	cfgtest_header_presence 'sys/sendfile.h'
+	cfgtest_header_presence 'sys/syscall.h'
+	cfgtest_header_presence 'sys/sysmacros.h'
+	cfgtest_header_presence 'sys/uio.h'
+	cfgtest_header_presence 'sys/xattr.h'
+
+	# interfaces
+	mb_cfgtest_headers='sys/epoll.h'
+	cfgtest_interface_presence 'epoll_create1'
+
+	mb_cfgtest_headers='sched.h'
+	cfgtest_interface_presence 'sched_get_priority_max'
+	cfgtest_interface_presence 'sched_rr_get_interval'
+	cfgtest_interface_presence 'sched_setaffinity'
+	cfgtest_interface_presence 'sched_setparam'
+	cfgtest_interface_presence 'sched_setscheduler'
+
+	mb_cfgtest_headers='sys/sendfile.h'
+	cfgtest_interface_presence 'sendfile'
 
 	# ncurses: python refers to members of typedef struct _win_st WINDOW
 	cfgtest_cflags_append '-DNCURSES_INTERNALS'
-- 
cgit v1.2.3