[Python-checkins] r63562 - in python/trunk: Include/pyport.h Misc/NEWS Modules/_ctypes/libffi/configure Modules/_ctypes/libffi/configure.ac Modules/_ctypes/malloc_closure.c configure configure.in pyconfig.h.in setup.py

martin.v.loewis python-checkins at python.org
Fri May 23 17:06:51 CEST 2008


Author: martin.v.loewis
Date: Fri May 23 17:06:50 2008
New Revision: 63562

Log:
Patch #1722225: Support QNX 6.


Modified:
   python/trunk/Include/pyport.h
   python/trunk/Misc/NEWS
   python/trunk/Modules/_ctypes/libffi/configure
   python/trunk/Modules/_ctypes/libffi/configure.ac
   python/trunk/Modules/_ctypes/malloc_closure.c
   python/trunk/configure
   python/trunk/configure.in
   python/trunk/pyconfig.h.in
   python/trunk/setup.py

Modified: python/trunk/Include/pyport.h
==============================================================================
--- python/trunk/Include/pyport.h	(original)
+++ python/trunk/Include/pyport.h	Fri May 23 17:06:50 2008
@@ -454,6 +454,13 @@
 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 <sys/termio.h>
+#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'

Modified: python/trunk/Misc/NEWS
==============================================================================
--- python/trunk/Misc/NEWS	(original)
+++ python/trunk/Misc/NEWS	Fri May 23 17:06:50 2008
@@ -224,6 +224,8 @@
 Build
 -----
 
+- Patch #1722225: Support QNX 6.
+
 - ``Lib/lib-old`` is now added to sys.path.
 
 

Modified: python/trunk/Modules/_ctypes/libffi/configure
==============================================================================
--- python/trunk/Modules/_ctypes/libffi/configure	(original)
+++ python/trunk/Modules/_ctypes/libffi/configure	Fri May 23 17:06:50 2008
@@ -20406,6 +20406,9 @@
   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
 	;;

Modified: python/trunk/Modules/_ctypes/libffi/configure.ac
==============================================================================
--- python/trunk/Modules/_ctypes/libffi/configure.ac	(original)
+++ python/trunk/Modules/_ctypes/libffi/configure.ac	Fri May 23 17:06:50 2008
@@ -86,6 +86,9 @@
   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
 	;;

Modified: python/trunk/Modules/_ctypes/malloc_closure.c
==============================================================================
--- python/trunk/Modules/_ctypes/malloc_closure.c	(original)
+++ python/trunk/Modules/_ctypes/malloc_closure.c	Fri May 23 17:06:50 2008
@@ -48,7 +48,11 @@
 	}
 #else
 	if (!_pagesize) {
+#ifdef _SC_PAGESIZE
+		_pagesize = sysconf(_SC_PAGESIZE);
+#else
 		_pagesize = getpagesize();
+#endif
 	}
 #endif
 

Modified: python/trunk/configure
==============================================================================
--- python/trunk/configure	(original)
+++ python/trunk/configure	Fri May 23 17:06:50 2008
@@ -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 @@
   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 @@
 	   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
@@ -5472,6 +5481,7 @@
 
 
 
+
 for ac_header in asm/types.h conio.h curses.h direct.h dlfcn.h errno.h \
 fcntl.h grp.h \
 ieeefp.h io.h langinfo.h libintl.h ncurses.h poll.h process.h pthread.h \
@@ -5480,7 +5490,7 @@
 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 @@
 			fi
 		fi
 		;;
-	Linux*|GNU*) LDSHARED='$(CC) -shared';;
+	Linux*|GNU*|QNX*) LDSHARED='$(CC) -shared';;
 	BSD/OS*/4*) LDSHARED="gcc -shared";;
 	FreeBSD*)
 		if [ "`$CC -dM -E - </dev/null | grep __ELF__`" != "" ]
@@ -12659,6 +12669,13 @@
 		then
 			LINKFORSHARED='-Wl,--out-implib=$(LDLIBRARY)'
 		fi;;
+	QNX*)
+		# -Wl,-E causes the symbols to be added to the dynamic
+		# symbol table so that they can be found when a module
+		# is loaded.  -N 2048K causes the stack size to be set
+		# to 2048 kilobytes so that the stack doesn't overflow
+		# when running test_compile.py.
+		LINKFORSHARED='-Wl,-E -N 2048K';;
 	esac
 fi
 { echo "$as_me:$LINENO: result: $LINKFORSHARED" >&5

Modified: python/trunk/configure.in
==============================================================================
--- python/trunk/configure.in	(original)
+++ python/trunk/configure.in	Fri May 23 17:06:50 2008
@@ -262,6 +262,11 @@
   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 @@
 	   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 @@
 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 @@
 			fi
 		fi
 		;;
-	Linux*|GNU*) LDSHARED='$(CC) -shared';;
+	Linux*|GNU*|QNX*) LDSHARED='$(CC) -shared';;
 	BSD/OS*/4*) LDSHARED="gcc -shared";;
 	FreeBSD*)
 		if [[ "`$CC -dM -E - </dev/null | grep __ELF__`" != "" ]]
@@ -1711,6 +1720,13 @@
 		then
 			LINKFORSHARED='-Wl,--out-implib=$(LDLIBRARY)'
 		fi;;
+	QNX*)
+		# -Wl,-E causes the symbols to be added to the dynamic
+		# symbol table so that they can be found when a module
+		# is loaded.  -N 2048K causes the stack size to be set
+		# to 2048 kilobytes so that the stack doesn't overflow
+		# when running test_compile.py.
+		LINKFORSHARED='-Wl,-E -N 2048K';;
 	esac
 fi
 AC_MSG_RESULT($LINKFORSHARED)

Modified: python/trunk/pyconfig.h.in
==============================================================================
--- python/trunk/pyconfig.h.in	(original)
+++ python/trunk/pyconfig.h.in	Fri May 23 17:06:50 2008
@@ -688,6 +688,9 @@
 /* Define to 1 if you have the <sys/stat.h> header file. */
 #undef HAVE_SYS_STAT_H
 
+/* Define to 1 if you have the <sys/termio.h> header file. */
+#undef HAVE_SYS_TERMIO_H
+
 /* Define to 1 if you have the <sys/times.h> header file. */
 #undef HAVE_SYS_TIMES_H
 

Modified: python/trunk/setup.py
==============================================================================
--- python/trunk/setup.py	(original)
+++ python/trunk/setup.py	Fri May 23 17:06:50 2008
@@ -1009,7 +1009,7 @@
                 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:


More information about the Python-checkins mailing list