--- a/Include/pyport.h Sun Feb 19 12:29:43 2012 +0100 +++ b/Include/pyport.h Sun Feb 19 22:20:00 2012 +0100 @@ -751,6 +751,30 @@ # endif /* HAVE_DECLSPEC */ #endif /* Py_ENABLE_SHARED */ +#ifndef HAVE_DECLSPEC_DLL +# ifdef Py_BUILD_CORE +# ifndef PyAPI_FUNC +# define PyAPI_FUNC(RTYPE) __attribute__ ((visibility ("default"))) RTYPE +# endif /* PyAPI_FUNC */ +# ifndef PyAPI_DATA +# define PyAPI_DATA(RTYPE) extern __attribute__ ((visibility ("default"))) RTYPE +# endif /* PyAPI_DATA */ + /* module init functions inside the core need no external linkage */ +# ifndef PyMODINIT_FUNC +# define PyMODINIT_FUNC void +# endif /* PyMODINIT_FUNC */ +# else /* Py_BUILD_CORE */ + /* module init functions outside the core must be exported */ +# ifndef PyMODINIT_FUNC +# if defined(__cplusplus) +# define PyMODINIT_FUNC extern "C" __attribute__ ((visibility ("default"))) void +# else /* __cplusplus */ +# define PyMODINIT_FUNC __attribute__ ((visibility ("default"))) void +# endif /* __cplusplus */ +# endif /* PyMODINIT_FUNC */ +# endif /* Py_BUILD_CORE */ +#endif /* HAVE_DECLSPEC_DLL */ + /* If no external linkage macros defined by now, create defaults */ #ifndef PyAPI_FUNC # define PyAPI_FUNC(RTYPE) RTYPE --- a/Lib/distutils/dist.py Sun Feb 19 12:29:43 2012 +0100 +++ b/Lib/distutils/dist.py Sun Feb 19 22:20:00 2012 +0100 @@ -458,7 +458,7 @@ parser.set_aliases({'licence': 'license'}) args = parser.getopt(args=self.script_args, object=self) option_order = parser.get_option_order() - log.set_verbosity(self.verbose) + log.set_verbosity(1) # for display options we return immediately if self.handle_display_options(option_order): --- a/Modules/_ctypes/_ctypes_test.c Sun Feb 19 12:29:43 2012 +0100 +++ b/Modules/_ctypes/_ctypes_test.c Sun Feb 19 22:20:00 2012 +0100 @@ -609,7 +609,7 @@ #endif -DL_EXPORT(void) +PyMODINIT_FUNC init_ctypes_test(void) { Py_InitModule("_ctypes_test", module_methods); --- a/Modules/_elementtree.c Sun Feb 19 12:29:43 2012 +0100 +++ b/Modules/_elementtree.c Sun Feb 19 22:20:00 2012 +0100 @@ -2860,7 +2860,7 @@ {NULL, NULL} }; -DL_EXPORT(void) +PyMODINIT_FUNC init_elementtree(void) { PyObject* m; --- a/Modules/_hotshot.c Sun Feb 19 12:29:43 2012 +0100 +++ b/Modules/_hotshot.c Sun Feb 19 22:20:00 2012 +0100 @@ -1604,7 +1604,7 @@ }; -void +PyMODINIT_FUNC init_hotshot(void) { PyObject *module; --- a/Modules/_json.c Sun Feb 19 12:29:43 2012 +0100 +++ b/Modules/_json.c Sun Feb 19 22:20:00 2012 +0100 @@ -2410,7 +2410,7 @@ PyDoc_STRVAR(module_doc, "json speedups\n"); -void +PyMODINIT_FUNC init_json(void) { PyObject *m; --- a/Modules/cjkcodecs/cjkcodecs.h Sun Feb 19 12:29:43 2012 +0100 +++ b/Modules/cjkcodecs/cjkcodecs.h Sun Feb 19 22:20:00 2012 +0100 @@ -387,7 +387,7 @@ #endif #define I_AM_A_MODULE_FOR(loc) \ - void \ + PyMODINIT_FUNC \ init_codecs_##loc(void) \ { \ PyObject *m = Py_InitModule("_codecs_" #loc, __methods);\ --- a/Modules/linuxaudiodev.c Sun Feb 19 12:29:43 2012 +0100 +++ b/Modules/linuxaudiodev.c Sun Feb 19 22:20:00 2012 +0100 @@ -465,7 +465,7 @@ { 0, 0 }, }; -void +PyMODINIT_FUNC initlinuxaudiodev(void) { PyObject *m; --- a/Modules/nismodule.c Sun Feb 19 12:29:43 2012 +0100 +++ b/Modules/nismodule.c Sun Feb 19 22:20:00 2012 +0100 @@ -434,7 +434,7 @@ PyDoc_STRVAR(nis__doc__, "This module contains functions for accessing NIS maps.\n"); -void +PyMODINIT_FUNC initnis (void) { PyObject *m, *d; --- a/Modules/ossaudiodev.c Sun Feb 19 12:29:43 2012 +0100 +++ b/Modules/ossaudiodev.c Sun Feb 19 22:20:00 2012 +0100 @@ -945,7 +945,7 @@ } -void +PyMODINIT_FUNC initossaudiodev(void) { PyObject *m; --- a/Modules/sunaudiodev.c Sun Feb 19 12:29:43 2012 +0100 +++ b/Modules/sunaudiodev.c Sun Feb 19 22:20:00 2012 +0100 @@ -448,7 +448,7 @@ { 0, 0 }, }; -void +PyMODINIT_FUNC initsunaudiodev(void) { PyObject *m, *d; --- a/Python/getargs.c Sun Feb 19 12:29:43 2012 +0100 +++ b/Python/getargs.c Sun Feb 19 22:20:00 2012 +0100 @@ -18,7 +18,6 @@ int PyArg_VaParseTupleAndKeywords(PyObject *, PyObject *, const char *, char **, va_list); -#ifdef HAVE_DECLSPEC_DLL /* Export functions */ PyAPI_FUNC(int) _PyArg_Parse_SizeT(PyObject *, char *, ...); PyAPI_FUNC(int) _PyArg_ParseTuple_SizeT(PyObject *, char *, ...); @@ -28,7 +27,6 @@ PyAPI_FUNC(int) _PyArg_VaParse_SizeT(PyObject *, char *, va_list); PyAPI_FUNC(int) _PyArg_VaParseTupleAndKeywords_SizeT(PyObject *, PyObject *, const char *, char **, va_list); -#endif #define FLAG_COMPAT 1 #define FLAG_SIZE_T 2 --- a/configure Sun Feb 19 12:29:43 2012 +0100 +++ b/configure Sun Feb 19 22:20:00 2012 +0100 @@ -7754,7 +7754,7 @@ then CCSHARED="-fPIC"; else CCSHARED="+z"; fi;; - Linux*|GNU*) CCSHARED="-fPIC";; + Linux*|GNU*) CCSHARED="-fPIC -fvisibility=hidden";; BSD/OS*/4*) CCSHARED="-fpic";; FreeBSD*|NetBSD*|OpenBSD*|DragonFly*) CCSHARED="-fPIC";; OpenUNIX*|UnixWare*) --- a/configure.in Sun Feb 19 12:29:43 2012 +0100 +++ b/configure.in Sun Feb 19 22:20:00 2012 +0100 @@ -1938,7 +1938,7 @@ then CCSHARED="-fPIC"; else CCSHARED="+z"; fi;; - Linux*|GNU*) CCSHARED="-fPIC";; + Linux*|GNU*) CCSHARED="-fPIC -fvisibility=hidden";; BSD/OS*/4*) CCSHARED="-fpic";; FreeBSD*|NetBSD*|OpenBSD*|DragonFly*) CCSHARED="-fPIC";; OpenUNIX*|UnixWare*)