[PATCH 1/2] Run build_configure from build_ext.

Sebastian Ramacher s.ramacher at gmx.at
Sat Oct 29 10:20:01 CST 2011


When installing with easy_install build_ext ist called directly. Thus we have to
ensure that build_configure is run before we're building the extensions in
build_ext.
---
 setup.py |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/setup.py b/setup.py
index 0f1ef01..13dda2d 100644
--- a/setup.py
+++ b/setup.py
@@ -287,12 +287,17 @@ class PCTBuildExt (build_ext):
             f.close()
         return result
 
-class PCTBuild(build):
+    def run(self):
+        for cmd_name in self.get_sub_commands():
+            self.run_command(cmd_name)
+        
+        build_ext.run(self)
+
     def has_configure(self):
         compiler = new_compiler(compiler=self.compiler)
         return compiler.compiler_type != 'msvc'
 
-    sub_commands = [ ('build_configure', has_configure) ] + build.sub_commands
+    sub_commands = [ ('build_configure', has_configure) ] + build_ext.sub_commands
 
 class PCTBuildConfigure(Command):
     description = "Generate config.h using ./configure (autoconf)"
@@ -384,7 +389,7 @@ kw = {'name':"pycrypto",
       'author_email':"dlitz at dlitz.net",
       'url':"http://www.pycrypto.org/",
 
-      'cmdclass' : {'build': PCTBuild, 'build_configure': PCTBuildConfigure, 'build_ext':PCTBuildExt, 'build_py': PCTBuildPy, 'test': TestCommand },
+      'cmdclass' : {'build_configure': PCTBuildConfigure, 'build_ext': PCTBuildExt, 'build_py': PCTBuildPy, 'test': TestCommand },
       'packages' : ["Crypto", "Crypto.Hash", "Crypto.Cipher", "Crypto.Util",
                   "Crypto.Random",
                   "Crypto.Random.Fortuna",
-- 
1.7.7.1


--------------030208040306030506090403
Content-Type: text/x-diff;
 name="0002-Also-ship-configure-configure.ac-and-src-config.h.in.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename*0="0002-Also-ship-configure-configure.ac-and-src-config.h.in.pa";
 filename*1="tch"



More information about the pycrypto mailing list