diff --git a/Include/osdefs.h b/Include/osdefs.h index bd84c1c12c19fd..3243944a1483e9 100644 --- a/Include/osdefs.h +++ b/Include/osdefs.h @@ -14,6 +14,10 @@ extern "C" { #define DELIM L';' #endif +#ifdef __VXWORKS__ +#define DELIM L';' +#endif + /* Filename separator */ #ifndef SEP #define SEP L'/' diff --git a/Include/symtable.h b/Include/symtable.h index 86ae3c28e878e0..b5ab0e6b976605 100644 --- a/Include/symtable.h +++ b/Include/symtable.h @@ -103,6 +103,10 @@ PyAPI_FUNC(void) PySymtable_Free(struct symtable *); #define SCOPE_OFFSET 11 #define SCOPE_MASK (DEF_GLOBAL | DEF_LOCAL | DEF_PARAM | DEF_NONLOCAL) +#ifdef __VXWORKS__ + #undef LOCAL +#endif + #define LOCAL 1 #define GLOBAL_EXPLICIT 2 #define GLOBAL_IMPLICIT 3 diff --git a/Makefile.pre.in b/Makefile.pre.in index 5a001ecbe7303b..5ab5b928c8194e 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in @@ -56,6 +56,7 @@ DTRACE_HEADERS= @DTRACE_HEADERS@ DTRACE_OBJS= @DTRACE_OBJS@ GNULD= @GNULD@ +PY_ENABLE_SHARED=@PY_ENABLE_SHARED@ # Shell used by make (some versions default to the login shell, which is bad) SHELL= /bin/sh @@ -101,11 +102,19 @@ PY_LDFLAGS= $(CONFIGURE_LDFLAGS) $(LDFLAGS) NO_AS_NEEDED= @NO_AS_NEEDED@ LDLAST= @LDLAST@ SGI_ABI= @SGI_ABI@ -CCSHARED= @CCSHARED@ -LINKFORSHARED= @LINKFORSHARED@ -ARFLAGS= @ARFLAGS@ + +ifeq ($(PY_ENABLE_SHARED),1) +CCSHARED= @CCSHARED@ +LINKFORSHARED= @LINKFORSHARED@ # Extra C flags added for building the interpreter object files. CFLAGSFORSHARED=@CFLAGSFORSHARED@ +else +CCSHARED= +LINKFORSHARED= +CFLAGSFORSHARED= +endif + +ARFLAGS= @ARFLAGS@ # C flags used for building the interpreter object files PY_CORE_CFLAGS= $(PY_CFLAGS) $(PY_CFLAGS_NODIST) $(PY_CPPFLAGS) $(CFLAGSFORSHARED) -DPy_BUILD_CORE # Strict or non-strict aliasing flags used to compile dtoa.c, see above @@ -440,7 +449,11 @@ DTRACE_DEPS = \ # Default target all: @DEF_MAKE_ALL_RULE@ -build_all: $(BUILDPYTHON) oldsharedmods sharedmods gdbhooks Programs/_testembed python-config +ifeq ($(PY_ENABLE_SHARED),1) +build_all: $(BUILDPYTHON) oldsharedmods sharedmods gdbhooks Programs/_testembed python-config +else +build_all: $(BUILDPYTHON) gdbhooks Programs/_testembed python-config +endif # Compile a binary with profile guided optimization. profile-opt: diff --git a/Modules/_multiprocessing/multiprocessing.h b/Modules/_multiprocessing/multiprocessing.h index 512bc17f23d46b..29decdf15f9c98 100644 --- a/Modules/_multiprocessing/multiprocessing.h +++ b/Modules/_multiprocessing/multiprocessing.h @@ -32,8 +32,12 @@ # define BOOL int # define UINT32 uint32_t # define INT32 int32_t -# define TRUE 1 -# define FALSE 0 +# ifndef TRUE +# define TRUE 1 +# endif +# ifndef FALSE +# define FALSE 0 +# endif # define INVALID_HANDLE_VALUE (-1) #endif diff --git a/Modules/faulthandler.c b/Modules/faulthandler.c index 4f3d971bc5270b..7c4e25406d5ba8 100644 --- a/Modules/faulthandler.c +++ b/Modules/faulthandler.c @@ -13,7 +13,9 @@ #ifdef HAVE_SYS_RESOURCE_H # include #endif - +#ifdef __VXWORKS__ +# include +#endif /* Allocate at maximum 100 MB of the stack to raise the stack overflow */ #define STACK_OVERFLOW_MAX_SIZE (100*1024*1024) diff --git a/Modules/fcntlmodule.c b/Modules/fcntlmodule.c index 0baaa83d2acae5..749db9143fdc09 100644 --- a/Modules/fcntlmodule.c +++ b/Modules/fcntlmodule.c @@ -15,6 +15,10 @@ #include #endif +#ifdef __VXWORKS__ +#include /* ioctl() */ +#endif + /*[clinic input] module fcntl [clinic start generated code]*/ diff --git a/Modules/getbuildinfo.c b/Modules/getbuildinfo.c index 5f941a26e1d54c..92ffa803cd8de4 100644 --- a/Modules/getbuildinfo.c +++ b/Modules/getbuildinfo.c @@ -4,6 +4,11 @@ #include #endif +#ifdef __VXWORKS__ +#undef DATE +#undef TIME +#endif + #ifndef DATE #ifdef __DATE__ #define DATE __DATE__ diff --git a/Modules/mmapmodule.c b/Modules/mmapmodule.c index 49214a1defce89..60aaafac991426 100644 --- a/Modules/mmapmodule.c +++ b/Modules/mmapmodule.c @@ -1463,9 +1463,9 @@ PyInit_mmap(void) #endif setint(dict, "PAGESIZE", (long)my_getpagesize()); - +#ifndef __VXWORKS__ setint(dict, "ALLOCATIONGRANULARITY", (long)my_getallocationgranularity()); - +#endif setint(dict, "ACCESS_READ", ACCESS_READ); setint(dict, "ACCESS_WRITE", ACCESS_WRITE); setint(dict, "ACCESS_COPY", ACCESS_COPY); diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index 83135e536a51b2..805ad02a4d3d54 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -174,6 +174,7 @@ corresponding Unix manual entries for more information on calls."); #define HAVE_FSYNC 1 #define fsync _commit #else +#ifndef __VXWORKS__ /* Unix functions that the configure script doesn't check for */ #define HAVE_EXECV 1 #define HAVE_FORK 1 @@ -184,6 +185,7 @@ corresponding Unix manual entries for more information on calls."); #define HAVE_GETEUID 1 #define HAVE_GETGID 1 #define HAVE_GETPPID 1 +#endif #define HAVE_GETUID 1 #define HAVE_KILL 1 #define HAVE_OPENDIR 1 diff --git a/Modules/signalmodule.c b/Modules/signalmodule.c index 663310881768e8..836da002a8f530 100644 --- a/Modules/signalmodule.c +++ b/Modules/signalmodule.c @@ -965,11 +965,18 @@ fill_siginfo(siginfo_t *si) PyStructSequence_SET_ITEM(result, 0, PyLong_FromLong((long)(si->si_signo))); PyStructSequence_SET_ITEM(result, 1, PyLong_FromLong((long)(si->si_code))); +#ifdef __VXWORKS__ + PyStructSequence_SET_ITEM(result, 2, PyLong_FromLong(0L)); + PyStructSequence_SET_ITEM(result, 3, PyLong_FromLong(0L)); + PyStructSequence_SET_ITEM(result, 4, PyLong_FromLong(0L)); + PyStructSequence_SET_ITEM(result, 5, PyLong_FromLong(0L)); +#else PyStructSequence_SET_ITEM(result, 2, PyLong_FromLong((long)(si->si_errno))); PyStructSequence_SET_ITEM(result, 3, PyLong_FromPid(si->si_pid)); PyStructSequence_SET_ITEM(result, 4, _PyLong_FromUid(si->si_uid)); PyStructSequence_SET_ITEM(result, 5, PyLong_FromLong((long)(si->si_status))); +#endif #ifdef HAVE_SIGINFO_T_SI_BAND PyStructSequence_SET_ITEM(result, 6, PyLong_FromLong(si->si_band)); #else diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c index 5df9d014c35a72..137b21779bcec9 100644 --- a/Modules/socketmodule.c +++ b/Modules/socketmodule.c @@ -97,6 +97,7 @@ Local naming conventions: # pragma weak inet_aton #endif + #include "Python.h" #include "structmember.h" @@ -159,7 +160,7 @@ if_indextoname(index) -- return the corresponding interface name\n\ # undef HAVE_GETHOSTBYNAME_R_6_ARG #endif -#if defined(__OpenBSD__) +#if defined(__OpenBSD__) || defined(__VXWORKS__) # include #endif @@ -181,6 +182,12 @@ if_indextoname(index) -- return the corresponding interface name\n\ # endif #endif +#ifdef __VXWORKS__ +# include +# define gethostbyaddr_r( a1, a2, a3, a4, a5, a6, a7 ) ipcom_gethostbyaddr_r( a1, a2, a3, a4, a5, a6, a7 ) +# include +#endif + #if !defined(HAVE_GETHOSTBYNAME_R) && !defined(MS_WINDOWS) # define USE_GETHOSTBYNAME_LOCK #endif @@ -532,7 +539,7 @@ set_error(void) return PyErr_SetFromErrno(PyExc_OSError); } - +#ifndef __VXWORKS__ static PyObject * set_herror(int h_error) { @@ -550,7 +557,7 @@ set_herror(int h_error) return NULL; } - +#endif static PyObject * set_gaierror(int error) @@ -903,7 +910,7 @@ init_sockobject(PySocketSockObject *s, return 0; } - +#ifdef HAVE_SOCKETPAIR /* Create a new socket object. This just creates the object and initializes it. If the creation fails, return NULL and set an exception (implicit @@ -923,7 +930,7 @@ new_sockobject(SOCKET_T fd, int family, int type, int proto) } return s; } - +#endif /* Lock to allow python interpreter to continue, but only allow one thread to be in gethostbyname or getaddrinfo */ @@ -2314,17 +2321,17 @@ cmsg_min_space(struct msghdr *msg, struct cmsghdr *cmsgh, size_t space) #endif if (msg->msg_controllen < 0) return 0; + if (space < cmsg_len_end) + space = cmsg_len_end; + cmsg_offset = (char *)cmsgh - (char *)msg->msg_control; + return (cmsg_offset <= (size_t)-1 - space && + cmsg_offset + space <= msg->msg_controllen); #if defined(__GNUC__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ > 5))) #pragma GCC diagnostic pop #endif #ifdef __clang__ #pragma clang diagnostic pop #endif - if (space < cmsg_len_end) - space = cmsg_len_end; - cmsg_offset = (char *)cmsgh - (char *)msg->msg_control; - return (cmsg_offset <= (size_t)-1 - space && - cmsg_offset + space <= msg->msg_controllen); } /* If pointer CMSG_DATA(cmsgh) is in buffer msg->msg_control, set @@ -5079,7 +5086,9 @@ gethost_common(struct hostent *h, struct sockaddr *addr, size_t alen, int af) if (h == NULL) { /* Let's get real error message to return */ +#ifndef __VXWORKS__ set_herror(h_errno); +#endif return NULL; } @@ -5426,6 +5435,7 @@ Return the service name from a port number and protocol name.\n\ The optional protocol name, if given, should be 'tcp' or 'udp',\n\ otherwise any protocol will match."); +#ifndef __VXWORKS__ /* Python interface to getprotobyname(name). This only returns the protocol number, since the other info is already known or not useful (like the list of aliases). */ @@ -5452,7 +5462,7 @@ PyDoc_STRVAR(getprotobyname_doc, "getprotobyname(name) -> integer\n\ \n\ Return the protocol number for the named protocol. (Rarely used.)"); - +#endif #ifndef NO_DUP /* dup() function for socket fds */ @@ -6392,8 +6402,10 @@ static PyMethodDef socket_methods[] = { METH_VARARGS, getservbyname_doc}, {"getservbyport", socket_getservbyport, METH_VARARGS, getservbyport_doc}, +#ifndef __VXWORKS__ {"getprotobyname", socket_getprotobyname, METH_VARARGS, getprotobyname_doc}, +#endif #ifndef NO_DUP {"dup", socket_dup, METH_O, dup_doc}, diff --git a/Modules/syslogmodule.c b/Modules/syslogmodule.c index a5807dcce9ce5b..d7cbd1930a135d 100644 --- a/Modules/syslogmodule.c +++ b/Modules/syslogmodule.c @@ -54,6 +54,10 @@ Revision history: #include +#ifndef LOG_UPTO +#define LOG_UPTO(pri) ((1 << ((pri)+1)) - 1) /* all priorities through pri */ +#endif + /* only one instance, only one syslog, so globals should be ok */ static PyObject *S_ident_o = NULL; /* identifier, held by openlog() */ static char S_log_open = 0; diff --git a/Modules/timemodule.c b/Modules/timemodule.c index 36a95bbcedd6fe..3b7a2f1f0e3e7e 100644 --- a/Modules/timemodule.c +++ b/Modules/timemodule.c @@ -1215,6 +1215,7 @@ PyInit_timezone(PyObject *m) { #if defined(HAVE_TZNAME) && !defined(__GLIBC__) && !defined(__CYGWIN__) PyObject *otz0, *otz1; tzset(); +#ifndef __VXWORKS__ PyModule_AddIntConstant(m, "timezone", timezone); #ifdef HAVE_ALTZONE PyModule_AddIntConstant(m, "altzone", altzone); @@ -1222,6 +1223,7 @@ PyInit_timezone(PyObject *m) { PyModule_AddIntConstant(m, "altzone", timezone-3600); #endif PyModule_AddIntConstant(m, "daylight", daylight); +#endif otz0 = PyUnicode_DecodeLocale(tzname[0], "surrogateescape"); otz1 = PyUnicode_DecodeLocale(tzname[1], "surrogateescape"); PyModule_AddObject(m, "tzname", Py_BuildValue("(NN)", otz0, otz1)); diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c index 5c8cf5b9bd5fc0..e9a45f92a714bd 100644 --- a/Python/pylifecycle.c +++ b/Python/pylifecycle.c @@ -1421,6 +1421,10 @@ initfsencoding(PyInterpreterState *interp) Py_FileSystemDefaultEncoding = "utf-8"; Py_FileSystemDefaultEncodeErrors = "surrogatepass"; } +#elif defined(__VXWORKS__) + { + Py_FileSystemDefaultEncoding = "ascii"; + } #else if (Py_FileSystemDefaultEncoding == NULL) { diff --git a/configure b/configure index 00dd1f0514a69c..e1d2797642371c 100755 --- a/configure +++ b/configure @@ -3258,6 +3258,9 @@ then *-*-cygwin*) ac_sys_system=Cygwin ;; + *-*-vxworks*) + ac_sys_system=VxWorks + ;; *) # for now, limit cross builds to known configurations MACHDEP="unknown" @@ -3302,6 +3305,9 @@ if test "$cross_compiling" = yes; then *-*-cygwin*) _host_cpu= ;; + *-*-vxworks*) + _host_cpu= + ;; *) # for now, limit cross builds to known configurations MACHDEP="unknown" @@ -3320,6 +3326,10 @@ fi # wildcard, and that the wildcard does not include future systems # (which may remove their limitations). case $ac_sys_system/$ac_sys_release in + # On VxWorks if _XOPEN_SOURCE is defined the socket.h header + # has undefined types. + VxWorks* ) + define_xopen_source=no;; # On OpenBSD, select(2) is not available if _XOPEN_SOURCE is defined, # even though select is a POSIX function. Reported by J. Ribbens. # Reconfirmed for OpenBSD 3.3 by Zachary Hamm, for 3.4 by Jason Ish. @@ -13299,7 +13309,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_char_unsigned" >&5 $as_echo "$ac_cv_c_char_unsigned" >&6; } -if test $ac_cv_c_char_unsigned = yes && test "$GCC" != yes; then +if test $ac_cv_c_char_unsigned = yes && test "$GCC" != yes && test "$ac_sys_system" != "VxWorks" ; then $as_echo "#define __CHAR_UNSIGNED__ 1" >>confdefs.h fi diff --git a/configure.ac b/configure.ac index 88ab6a121571c4..c3540735453512 100644 --- a/configure.ac +++ b/configure.ac @@ -377,6 +377,9 @@ then *-*-cygwin*) ac_sys_system=Cygwin ;; + *-*-vxworks*) + ac_sys_system=VxWorks + ;; *) # for now, limit cross builds to known configurations MACHDEP="unknown" @@ -418,9 +421,12 @@ if test "$cross_compiling" = yes; then _host_cpu=$host_cpu esac ;; - *-*-cygwin*) - _host_cpu= - ;; + *-*-cygwin*) + _host_cpu= + ;; + *-*-vxworks*) + _host_cpu=$host_cpu + ;; *) # for now, limit cross builds to known configurations MACHDEP="unknown" @@ -509,6 +515,11 @@ case $ac_sys_system/$ac_sys_release in QNX/6.3.2) define_xopen_source=no ;; + # On VxWorks, defining _XOPEN_SOURCE causes compile failures + # in network headers still using system V types. + VxWorks/*) + define_xopen_source=no + ;; esac @@ -3996,7 +4007,10 @@ fi # checks for compiler characteristics -AC_C_CHAR_UNSIGNED +# test results in duplicate def of __CHAR_UNSIGNED__ on VxWorks +if test "$ac_sys_system" != "VxWorks" ; then + AC_C_CHAR_UNSIGNED +fi AC_C_CONST works=no diff --git a/setup.py b/setup.py index d5c58e0686981f..fa9ed07c9b8ecb 100644 --- a/setup.py +++ b/setup.py @@ -275,6 +275,14 @@ def build_extensions(self): if compiler is not None: (ccshared,cflags) = sysconfig.get_config_vars('CCSHARED','CFLAGS') args['compiler_so'] = compiler + ' ' + ccshared + ' ' + cflags + + #VxWorks uses '@filepath' extension to add include paths without overflowing windows cmd line buffer + if host_platform == 'vxworks': + cppflags = sysconfig.get_config_var('CPPFLAGS').split() + for item in cppflags: + self.announce('ITEM: "%s"' % item ) + if item.startswith('@'): + args['compiler_so'] = compiler + ' ' + ccshared + ' ' + cflags + ' '+ item self.compiler.set_executables(**args) build_ext.build_extensions(self) @@ -503,7 +511,7 @@ def add_gcc_paths(self): def detect_math_libs(self): # Check for MacOS X, which doesn't need libm.a at all - if host_platform == 'darwin': + if (host_platform == 'darwin' or host_platform == 'vxworks'): return [] else: return ['m'] @@ -516,7 +524,7 @@ def detect_modules(self): add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') add_dir_to_list(self.compiler.include_dirs, '/usr/local/include') # only change this for cross builds for 3.3, issues on Mageia - if cross_compiling: + if ( cross_compiling and not host_platform == 'vxworks'): self.add_gcc_paths() self.add_multiarch_paths() @@ -554,9 +562,10 @@ def detect_modules(self): for directory in reversed(options.dirs): add_dir_to_list(dir_list, directory) - if (not cross_compiling and + if ((not cross_compiling and os.path.normpath(sys.base_prefix) != '/usr' and - not sysconfig.get_config_var('PYTHONFRAMEWORK')): + not sysconfig.get_config_var('PYTHONFRAMEWORK')) or + host_platform == 'vxworks'): # OSX note: Don't add LIBDIR and INCLUDEDIR to building a framework # (PYTHONFRAMEWORK is set) to avoid # linking problems when # building a framework with different architectures than @@ -566,6 +575,14 @@ def detect_modules(self): add_dir_to_list(self.compiler.include_dirs, sysconfig.get_config_var("INCLUDEDIR")) + #VxWorks requires some macros from CPPFLAGS to select the correct CPU headers + if host_platform == 'vxworks': + cppflags = sysconfig.get_config_var('CPPFLAGS').split() + for item in cppflags: + self.announce('ITEM: "%s"' % item ) + if item.startswith('-D'): + self.compiler.define_macro(item[2:]) + # lib_dirs and inc_dirs are used to search for files; # if a file is found in one of those directories, it can # be assumed that no additional -I,-L directives are needed. @@ -613,6 +630,7 @@ def detect_modules(self): if item.startswith('-L'): lib_dirs.append(item[2:]) + math_libs = self.detect_math_libs() # XXX Omitted modules: gl, pure, dl, SGI-specific modules @@ -694,7 +712,8 @@ def detect_modules(self): # pwd(3) exts.append( Extension('pwd', ['pwdmodule.c']) ) # grp(3) - exts.append( Extension('grp', ['grpmodule.c']) ) + if host_platform != 'vxworks': + exts.append( Extension('grp', ['grpmodule.c']) ) # spwd, shadow passwords if (config_h_vars.get('HAVE_GETSPNAM', False) or config_h_vars.get('HAVE_GETSPENT', False)): @@ -827,17 +846,19 @@ def detect_modules(self): libs = ['crypt'] else: libs = [] - exts.append( Extension('_crypt', ['_cryptmodule.c'], libraries=libs) ) + if host_platform != 'vxworks': + exts.append( Extension('_crypt', ['_cryptmodule.c'], libraries=libs) ) # CSV files exts.append( Extension('_csv', ['_csv.c']) ) # POSIX subprocess module helper. - exts.append( Extension('_posixsubprocess', ['_posixsubprocess.c']) ) + if host_platform != 'vxworks': + exts.append( Extension('_posixsubprocess', ['_posixsubprocess.c']) ) # socket(2) exts.append( Extension('_socket', ['socketmodule.c'], - depends = ['socketmodule.h']) ) + depends = ['socketmodule.h'] ) ) # Detect SSL support for the socket module (via _ssl) search_for_ssl_incs_in = [ '/usr/local/ssl/include', @@ -851,20 +872,31 @@ def detect_modules(self): ['/usr/kerberos/include']) if krb5_h: ssl_incs += krb5_h - ssl_libs = find_library_file(self.compiler, 'ssl',lib_dirs, + if host_platform == 'vxworks': + ssl_libs = find_library_file(self.compiler, 'OPENSSL',lib_dirs, [] ) + if (ssl_incs is not None and + ssl_libs is not None): + exts.append( Extension('_ssl', ['_ssl.c'], + include_dirs = ssl_incs, + library_dirs = ssl_libs, + libraries = ['OPENSSL', 'HASH'], + depends = ['socketmodule.h']), ) + else: + missing.append('_ssl') + else: + ssl_libs = find_library_file(self.compiler, 'ssl',lib_dirs, ['/usr/local/ssl/lib', '/usr/contrib/ssl/lib/' ] ) - - if (ssl_incs is not None and - ssl_libs is not None): - exts.append( Extension('_ssl', ['_ssl.c'], + if (ssl_incs is not None and + ssl_libs is not None): + exts.append( Extension('_ssl', ['_ssl.c'], include_dirs = ssl_incs, library_dirs = ssl_libs, libraries = ['ssl', 'crypto'], depends = ['socketmodule.h']), ) - else: - missing.append('_ssl') + else: + missing.append('_ssl') # find out which version of OpenSSL we have openssl_ver = 0 @@ -898,11 +930,18 @@ def detect_modules(self): if have_usable_openssl: # The _hashlib module wraps optimized implementations # of hash functions from the OpenSSL library. - exts.append( Extension('_hashlib', ['_hashopenssl.c'], + if host_platform != 'vxworks': + exts.append( Extension('_hashlib', ['_hashopenssl.c'], depends = ['hashlib.h'], include_dirs = ssl_incs, library_dirs = ssl_libs, libraries = ['ssl', 'crypto']) ) + else : + exts.append( Extension('_hashlib', ['_hashopenssl.c'], + depends = ['hashlib.h'], + include_dirs = ssl_incs, + library_dirs = ssl_libs, + libraries = ['OPENSSL', 'HASH']) ) else: print("warning: openssl 0x%08x is too old for _hashlib" % openssl_ver) @@ -1354,7 +1393,7 @@ class db_found(Exception): pass missing.append('_gdbm') # Unix-only modules - if host_platform != 'win32': + if host_platform != 'win32' and host_platform != 'vxworks': # Steen Lumholt's termios module exts.append( Extension('termios', ['termios.c']) ) # Jeremy Hylton's rlimit interface @@ -1483,8 +1522,8 @@ class db_found(Exception): pass libraries = ['z'] extra_link_args = zlib_extra_link_args else: - extra_compile_args = [] libraries = [] + extra_compile_args = [] extra_link_args = [] exts.append( Extension('binascii', ['binascii.c'], extra_compile_args = extra_compile_args, @@ -1536,7 +1575,6 @@ class db_found(Exception): pass # call XML_SetHashSalt(), expat entropy sources are not needed ('XML_POOR_ENTROPY', '1'), ] - extra_compile_args = [] expat_lib = [] expat_sources = ['expat/xmlparse.c', 'expat/xmlrole.c', @@ -1587,10 +1625,12 @@ class db_found(Exception): pass # Hye-Shik Chang's CJKCodecs modules. exts.append(Extension('_multibytecodec', - ['cjkcodecs/multibytecodec.c'])) + ['cjkcodecs/multibytecodec.c'], + )) for loc in ('kr', 'jp', 'cn', 'tw', 'hk', 'iso2022'): exts.append(Extension('_codecs_%s' % loc, - ['cjkcodecs/_codecs_%s.c' % loc])) + ['cjkcodecs/_codecs_%s.c' % loc], + )) # Stefan Krah's _decimal module exts.append(self._decimal_ext()) @@ -1708,7 +1748,6 @@ def detect_tkinter_explicitly(self): extra_link_args = tcltk_libs.split() ext = Extension('_tkinter', ['_tkinter.c', 'tkappinit.c'], define_macros=[('WITH_APPINIT', 1)], - extra_compile_args = extra_compile_args, extra_link_args = extra_link_args, ) self.extensions.append(ext) @@ -1911,7 +1950,7 @@ def detect_tkinter(self, inc_dirs, lib_dirs): define_macros=[('WITH_APPINIT', 1)] + defs, include_dirs = include_dirs, libraries = libs, - library_dirs = added_lib_dirs, + library_dirs = added_lib_dirs ) self.extensions.append(ext) @@ -1995,14 +2034,15 @@ def detect_ctypes(self, inc_dirs, lib_dirs): ext = Extension('_ctypes', include_dirs=include_dirs, - extra_compile_args=extra_compile_args, - extra_link_args=extra_link_args, + extra_compile_args = extra_compile_args, libraries=[], sources=sources, depends=depends) # function my_sqrt() needs math library for sqrt() ext_test = Extension('_ctypes_test', sources=['_ctypes/_ctypes_test.c'], + extra_link_args=extra_link_args, + extra_compile_args = extra_compile_args, libraries=math_libs) self.extensions.extend([ext, ext_test])