diff --git a/Include/pyport.h b/Include/pyport.h index 4656f8c086d..7c684f7320f 100644 --- a/Include/pyport.h +++ b/Include/pyport.h @@ -454,6 +454,13 @@ int shutdown( int, int ); extern char * _getpty(int *, int, mode_t, int); #endif +/* On QNX 6, struct termio must be declared by including sys/termio.h + if TCGETA, TCSETA, TCSETAW, or TCSETAF are used. sys/termio.h must + be included before termios.h or it will generate an error. */ +#ifdef HAVE_SYS_TERMIO_H +#include +#endif + #if defined(HAVE_OPENPTY) || defined(HAVE_FORKPTY) #if !defined(HAVE_PTY_H) && !defined(HAVE_LIBUTIL_H) /* BSDI does not supply a prototype for the 'openpty' and 'forkpty' diff --git a/Misc/NEWS b/Misc/NEWS index ec232a6b235..42d9f32937f 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -224,6 +224,8 @@ Library Build ----- +- Patch #1722225: Support QNX 6. + - ``Lib/lib-old`` is now added to sys.path. diff --git a/Modules/_ctypes/libffi/configure b/Modules/_ctypes/libffi/configure index ee8f63650e1..aaa79141902 100755 --- a/Modules/_ctypes/libffi/configure +++ b/Modules/_ctypes/libffi/configure @@ -20406,6 +20406,9 @@ case "$host" in i?86-*-solaris2.1[0-9]*) TARGET=X86_64; TARGETDIR=x86 ;; + i*86-*-nto-qnx*) + TARGET=X86; TARGETDIR=x86 + ;; i?86-*-*) TARGET=X86; TARGETDIR=x86 ;; diff --git a/Modules/_ctypes/libffi/configure.ac b/Modules/_ctypes/libffi/configure.ac index 0a85146b1ad..57c161befe1 100644 --- a/Modules/_ctypes/libffi/configure.ac +++ b/Modules/_ctypes/libffi/configure.ac @@ -86,6 +86,9 @@ case "$host" in i?86-*-solaris2.1[[0-9]]*) TARGET=X86_64; TARGETDIR=x86 ;; + i*86-*-nto-qnx*) + TARGET=X86; TARGETDIR=x86 + ;; i?86-*-*) TARGET=X86; TARGETDIR=x86 ;; diff --git a/Modules/_ctypes/malloc_closure.c b/Modules/_ctypes/malloc_closure.c index 4cd5dd6f5a2..73fc0d9bfd1 100644 --- a/Modules/_ctypes/malloc_closure.c +++ b/Modules/_ctypes/malloc_closure.c @@ -48,7 +48,11 @@ static void more_core(void) } #else if (!_pagesize) { +#ifdef _SC_PAGESIZE + _pagesize = sysconf(_SC_PAGESIZE); +#else _pagesize = getpagesize(); +#endif } #endif diff --git a/configure b/configure index 28275ce8c93..b24c829c8a1 100755 --- a/configure +++ b/configure @@ -1,5 +1,5 @@ #! /bin/sh -# From configure.in Revision: 62644 . +# From configure.in Revision: 63545 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.61 for python 2.6. # @@ -2078,6 +2078,11 @@ _ACEOF Darwin/[789].*) define_xopen_source=no ;; + # On QNX 6.3.2, defining _XOPEN_SOURCE prevents netdb.h from + # defining NI_NUMERICHOST. + QNX/6.3.2) + define_xopen_source=no + ;; esac @@ -3931,6 +3936,10 @@ then LINKCC="\$(srcdir)/Modules/makexp_aix Modules/python.exp $exp_extra \$(LIBRARY); $LINKCC";; Monterey64*) LINKCC="$LINKCC -L/usr/lib/ia64l64";; + QNX*) + # qcc must be used because the other compilers do not + # support -N. + LINKCC=qcc;; esac fi { echo "$as_me:$LINENO: result: $LINKCC" >&5 @@ -5470,6 +5479,7 @@ done + for ac_header in asm/types.h conio.h curses.h direct.h dlfcn.h errno.h \ @@ -5480,7 +5490,7 @@ unistd.h utime.h \ sys/audioio.h sys/bsdtty.h sys/epoll.h sys/event.h sys/file.h sys/loadavg.h \ sys/lock.h sys/mkdev.h sys/modem.h \ sys/param.h sys/poll.h sys/select.h sys/socket.h sys/statvfs.h sys/stat.h \ -sys/time.h \ +sys/termio.h sys/time.h \ sys/times.h sys/types.h sys/un.h sys/utsname.h sys/wait.h pty.h libutil.h \ sys/resource.h netpacket/packet.h sysexits.h bluetooth.h \ bluetooth/bluetooth.h linux/tipc.h @@ -12531,7 +12541,7 @@ then fi fi ;; - Linux*|GNU*) LDSHARED='$(CC) -shared';; + Linux*|GNU*|QNX*) LDSHARED='$(CC) -shared';; BSD/OS*/4*) LDSHARED="gcc -shared";; FreeBSD*) if [ "`$CC -dM -E - &5 diff --git a/configure.in b/configure.in index a7c96f90d00..b0de6eabd70 100644 --- a/configure.in +++ b/configure.in @@ -262,6 +262,11 @@ case $ac_sys_system/$ac_sys_release in Darwin/@<:@789@:>@.*) define_xopen_source=no ;; + # On QNX 6.3.2, defining _XOPEN_SOURCE prevents netdb.h from + # defining NI_NUMERICHOST. + QNX/6.3.2) + define_xopen_source=no + ;; esac @@ -597,6 +602,10 @@ then LINKCC="\$(srcdir)/Modules/makexp_aix Modules/python.exp $exp_extra \$(LIBRARY); $LINKCC";; Monterey64*) LINKCC="$LINKCC -L/usr/lib/ia64l64";; + QNX*) + # qcc must be used because the other compilers do not + # support -N. + LINKCC=qcc;; esac fi AC_MSG_RESULT($LINKCC) @@ -1143,7 +1152,7 @@ unistd.h utime.h \ sys/audioio.h sys/bsdtty.h sys/epoll.h sys/event.h sys/file.h sys/loadavg.h \ sys/lock.h sys/mkdev.h sys/modem.h \ sys/param.h sys/poll.h sys/select.h sys/socket.h sys/statvfs.h sys/stat.h \ -sys/time.h \ +sys/termio.h sys/time.h \ sys/times.h sys/types.h sys/un.h sys/utsname.h sys/wait.h pty.h libutil.h \ sys/resource.h netpacket/packet.h sysexits.h bluetooth.h \ bluetooth/bluetooth.h linux/tipc.h) @@ -1587,7 +1596,7 @@ then fi fi ;; - Linux*|GNU*) LDSHARED='$(CC) -shared';; + Linux*|GNU*|QNX*) LDSHARED='$(CC) -shared';; BSD/OS*/4*) LDSHARED="gcc -shared";; FreeBSD*) if [[ "`$CC -dM -E - header file. */ #undef HAVE_SYS_STAT_H +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TERMIO_H + /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TIMES_H diff --git a/setup.py b/setup.py index 4663cece8c1..79ad5aabe54 100644 --- a/setup.py +++ b/setup.py @@ -1009,7 +1009,7 @@ class PyBuildExt(build_ext): missing.append('resource') # Sun yellow pages. Some systems have the functions in libc. - if platform not in ['cygwin', 'atheos']: + if platform not in ['cygwin', 'atheos', 'qnx6']: if (self.compiler.find_library_file(lib_dirs, 'nsl')): libs = ['nsl'] else: