# DP: Modules/Setup.dist: patches to build some extensions statically

--- a/Modules/Setup.dist
+++ b/Modules/Setup.dist
@@ -168,7 +168,7 @@
 #_testcapi _testcapimodule.c    # Python C API test module
 #_random _randommodule.c	# Random number generator
 #atexit atexitmodule.c      # Register functions to be run at interpreter-shutdown
-#_elementtree -I$(srcdir)/Modules/expat -DHAVE_EXPAT_CONFIG_H -DUSE_PYEXPAT_CAPI _elementtree.c	# elementtree accelerator
+#_elementtree -I$(srcdir)/Modules/expat -DHAVE_EXPAT_CONFIG_H _elementtree.c	# elementtree accelerator
 #_pickle _pickle.c	# pickle accelerator
 #_datetime _datetimemodule.c	# datetime accelerator
 #_bisect _bisectmodule.c	# Bisection algorithms
@@ -197,10 +197,7 @@
 
 # Socket module helper for SSL support; you must comment out the other
 # socket line above, and possibly edit the SSL variable:
-#SSL=/usr/local/ssl
-#_ssl _ssl.c \
-#	-DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl \
-#	-L$(SSL)/lib -lssl -lcrypto
+#_ssl _ssl.c -lssl -lcrypto
 
 # The crypt module is now disabled by default because it breaks builds
 # on many systems (where -lcrypt is needed), e.g. Linux (I believe).
@@ -243,6 +240,7 @@
 #_sha256 sha256module.c
 #_sha512 sha512module.c
 
+#_hashlib _hashopenssl.c -lssl -lcrypto
 
 # The _tkinter module.
 #
@@ -331,6 +329,7 @@
 # Fred Drake's interface to the Python parser
 #parser parsermodule.c
 
+#_ctypes _ctypes/_ctypes.c _ctypes/callbacks.c _ctypes/callproc.c _ctypes/stgdict.c _ctypes/cfield.c _ctypes/malloc_closure.c -lffi
 
 # Lee Busby's SIGFPE modules.
 # The library to link fpectl with is platform specific.
@@ -365,7 +364,7 @@
 #
 # More information on Expat can be found at www.libexpat.org.
 #
-#pyexpat expat/xmlparse.c expat/xmlrole.c expat/xmltok.c pyexpat.c -I$(srcdir)/Modules/expat -DHAVE_EXPAT_CONFIG_H -DUSE_PYEXPAT_CAPI
+#pyexpat expat/xmlparse.c expat/xmlrole.c expat/xmltok.c pyexpat.c -I$(srcdir)/Modules/expat -DHAVE_EXPAT_CONFIG_H
 
 # Hye-Shik Chang's CJKCodecs
 
--- a/Modules/_elementtree.c
+++ b/Modules/_elementtree.c
@@ -2040,7 +2040,10 @@
 static struct PyExpat_CAPI* expat_capi;
 #define EXPAT(func) (expat_capi->func)
 #else
-#define EXPAT(func) (XML_##func)
+#define EXPAT(func) (PyExpat_XML_##func)
+#define PyExpat_XML_GetErrorLineNumber   PyExpat_XML_GetCurrentLineNumber
+#define PyExpat_XML_GetErrorColumnNumber PyExpat_XML_GetCurrentColumnNumber
+#define PyExpat_XML_GetErrorByteIndex    PyExpat_XML_GetCurrentByteIndex
 #endif
 
 typedef struct {
