Commits

Ralf Schmitt committed 6da32ef

do not change source controlled files when building gevent

run configure in build_temp instead and copy the pregenerated
ares_build.h.dist to build_temp on windows.

Run configure with /bin/sh instead of changing permissions.

Comments (0)

Files changed (3)

c-ares/ares_build.h

-#ifndef __CARES_BUILD_H
-#define __CARES_BUILD_H
-
-
-/* Copyright (C) 2009 - 2010 by Daniel Stenberg et al
- *
- * Permission to use, copy, modify, and distribute this software and its
- * documentation for any purpose and without fee is hereby granted, provided
- * that the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of M.I.T. not be used in advertising or
- * publicity pertaining to distribution of the software without specific,
- * written prior permission.  M.I.T. makes no representations about the
- * suitability of this software for any purpose.  It is provided "as is"
- * without express or implied warranty.
- */
-
-/* ================================================================ */
-/*               NOTES FOR CONFIGURE CAPABLE SYSTEMS                */
-/* ================================================================ */
-
-/*
- * NOTE 1:
- * -------
- *
- * See file ares_build.h.in, run configure, and forget that this file
- * exists it is only used for non-configure systems.
- * But you can keep reading if you want ;-)
- *
- */
-
-/* ================================================================ */
-/*                 NOTES FOR NON-CONFIGURE SYSTEMS                  */
-/* ================================================================ */
-
-/*
- * NOTE 1:
- * -------
- *
- * Nothing in this file is intended to be modified or adjusted by the
- * c-ares library user nor by the c-ares library builder.
- *
- * If you think that something actually needs to be changed, adjusted
- * or fixed in this file, then, report it on the c-ares development
- * mailing list: http://cool.haxx.se/mailman/listinfo/c-ares/
- *
- * Try to keep one section per platform, compiler and architecture,
- * otherwise, if an existing section is reused for a different one and
- * later on the original is adjusted, probably the piggybacking one can
- * be adversely changed.
- *
- * In order to differentiate between platforms/compilers/architectures
- * use only compiler built in predefined preprocessor symbols.
- *
- * This header file shall only export symbols which are 'cares' or 'CARES'
- * prefixed, otherwise public name space would be polluted.
- *
- * NOTE 2:
- * -------
- *
- * Right now you might be staring at file ares_build.h.dist or ares_build.h,
- * this is due to the following reason: file ares_build.h.dist is renamed
- * to ares_build.h when the c-ares source code distribution archive file is
- * created.
- *
- * File ares_build.h.dist is not included in the distribution archive.
- * File ares_build.h is not present in the git tree.
- *
- * The distributed ares_build.h file is only intended to be used on systems
- * which can not run the also distributed configure script.
- *
- * On systems capable of running the configure script, the configure process
- * will overwrite the distributed ares_build.h file with one that is suitable
- * and specific to the library being configured and built, which is generated
- * from the ares_build.h.in template file.
- *
- * If you check out from git on a non-configure platform, you must run the
- * appropriate buildconf* script to set up ares_build.h and other local files.
- *
- */
-
-/* ================================================================ */
-/*  DEFINITION OF THESE SYMBOLS SHALL NOT TAKE PLACE ANYWHERE ELSE  */
-/* ================================================================ */
-
-#ifdef CARES_SIZEOF_LONG
-#  error "CARES_SIZEOF_LONG shall not be defined except in ares_build.h"
-   Error Compilation_aborted_CARES_SIZEOF_LONG_already_defined
-#endif
-
-#ifdef CARES_TYPEOF_ARES_SOCKLEN_T
-#  error "CARES_TYPEOF_ARES_SOCKLEN_T shall not be defined except in ares_build.h"
-   Error Compilation_aborted_CARES_TYPEOF_ARES_SOCKLEN_T_already_defined
-#endif
-
-#ifdef CARES_SIZEOF_ARES_SOCKLEN_T
-#  error "CARES_SIZEOF_ARES_SOCKLEN_T shall not be defined except in ares_build.h"
-   Error Compilation_aborted_CARES_SIZEOF_ARES_SOCKLEN_T_already_defined
-#endif
-
-/* ================================================================ */
-/*    EXTERNAL INTERFACE SETTINGS FOR NON-CONFIGURE SYSTEMS ONLY    */
-/* ================================================================ */
-
-#if defined(__DJGPP__) || defined(__GO32__)
-#  define CARES_SIZEOF_LONG           4
-#  define CARES_TYPEOF_ARES_SOCKLEN_T int
-#  define CARES_SIZEOF_ARES_SOCKLEN_T 4
-
-#elif defined(__SALFORDC__)
-#  define CARES_SIZEOF_LONG           4
-#  define CARES_TYPEOF_ARES_SOCKLEN_T int
-#  define CARES_SIZEOF_ARES_SOCKLEN_T 4
-
-#elif defined(__BORLANDC__)
-#  define CARES_SIZEOF_LONG           4
-#  define CARES_TYPEOF_ARES_SOCKLEN_T int
-#  define CARES_SIZEOF_ARES_SOCKLEN_T 4
-
-#elif defined(__TURBOC__)
-#  define CARES_SIZEOF_LONG           4
-#  define CARES_TYPEOF_ARES_SOCKLEN_T int
-#  define CARES_SIZEOF_ARES_SOCKLEN_T 4
-
-#elif defined(__WATCOMC__)
-#  define CARES_SIZEOF_LONG           4
-#  define CARES_TYPEOF_ARES_SOCKLEN_T int
-#  define CARES_SIZEOF_ARES_SOCKLEN_T 4
-
-#elif defined(__POCC__)
-#  define CARES_SIZEOF_LONG           4
-#  define CARES_TYPEOF_ARES_SOCKLEN_T int
-#  define CARES_SIZEOF_ARES_SOCKLEN_T 4
-
-#elif defined(__LCC__)
-#  define CARES_SIZEOF_LONG           4
-#  define CARES_TYPEOF_ARES_SOCKLEN_T int
-#  define CARES_SIZEOF_ARES_SOCKLEN_T 4
-
-#elif defined(__SYMBIAN32__)
-#  define CARES_SIZEOF_LONG           4
-#  define CARES_TYPEOF_ARES_SOCKLEN_T unsigned int
-#  define CARES_SIZEOF_ARES_SOCKLEN_T 4
-
-#elif defined(__MWERKS__)
-#  define CARES_SIZEOF_LONG           4
-#  define CARES_TYPEOF_ARES_SOCKLEN_T int
-#  define CARES_SIZEOF_ARES_SOCKLEN_T 4
-
-#elif defined(_WIN32_WCE)
-#  define CARES_SIZEOF_LONG           4
-#  define CARES_TYPEOF_ARES_SOCKLEN_T int
-#  define CARES_SIZEOF_ARES_SOCKLEN_T 4
-
-#elif defined(__MINGW32__)
-#  define CARES_SIZEOF_LONG           4
-#  define CARES_TYPEOF_ARES_SOCKLEN_T int
-#  define CARES_SIZEOF_ARES_SOCKLEN_T 4
-
-#elif defined(__VMS)
-#  define CARES_SIZEOF_LONG           4
-#  define CARES_TYPEOF_ARES_SOCKLEN_T unsigned int
-#  define CARES_SIZEOF_ARES_SOCKLEN_T 4
-
-#elif defined(__OS400__)
-#  if defined(__ILEC400__)
-#    define CARES_SIZEOF_LONG           4
-#    define CARES_TYPEOF_ARES_SOCKLEN_T socklen_t
-#    define CARES_SIZEOF_ARES_SOCKLEN_T 4
-#    define CARES_PULL_SYS_TYPES_H      1
-#    define CARES_PULL_SYS_SOCKET_H     1
-#  endif
-
-#elif defined(__MVS__)
-#  if defined(__IBMC__) || defined(__IBMCPP__)
-#    if defined(_ILP32)
-#      define CARES_SIZEOF_LONG           4
-#    elif defined(_LP64)
-#      define CARES_SIZEOF_LONG           8
-#    endif
-#    define CARES_TYPEOF_ARES_SOCKLEN_T socklen_t
-#    define CARES_SIZEOF_ARES_SOCKLEN_T 4
-#    define CARES_PULL_SYS_TYPES_H      1
-#    define CARES_PULL_SYS_SOCKET_H     1
-#  endif
-
-#elif defined(__370__)
-#  if defined(__IBMC__) || defined(__IBMCPP__)
-#    if defined(_ILP32)
-#      define CARES_SIZEOF_LONG           4
-#    elif defined(_LP64)
-#      define CARES_SIZEOF_LONG           8
-#    endif
-#    define CARES_TYPEOF_ARES_SOCKLEN_T socklen_t
-#    define CARES_SIZEOF_ARES_SOCKLEN_T 4
-#    define CARES_PULL_SYS_TYPES_H      1
-#    define CARES_PULL_SYS_SOCKET_H     1
-#  endif
-
-#elif defined(TPF)
-#  define CARES_SIZEOF_LONG           8
-#  define CARES_TYPEOF_ARES_SOCKLEN_T int
-#  define CARES_SIZEOF_ARES_SOCKLEN_T 4
-
-/* ===================================== */
-/*    KEEP MSVC THE PENULTIMATE ENTRY    */
-/* ===================================== */
-
-#elif defined(_MSC_VER)
-#  define CARES_SIZEOF_LONG           4
-#  define CARES_TYPEOF_ARES_SOCKLEN_T int
-#  define CARES_SIZEOF_ARES_SOCKLEN_T 4
-
-/* ===================================== */
-/*    KEEP GENERIC GCC THE LAST ENTRY    */
-/* ===================================== */
-
-#elif defined(__GNUC__)
-#  if defined(__i386__) || defined(__ppc__)
-#    define CARES_SIZEOF_LONG           4
-#  elif defined(__x86_64__) || defined(__ppc64__)
-#    define CARES_SIZEOF_LONG           8
-#  endif
-#  define CARES_TYPEOF_ARES_SOCKLEN_T socklen_t
-#  define CARES_SIZEOF_ARES_SOCKLEN_T 4
-#  define CARES_PULL_SYS_TYPES_H      1
-#  define CARES_PULL_SYS_SOCKET_H     1
-
-#else
-#  error "Unknown non-configure build target!"
-   Error Compilation_aborted_Unknown_non_configure_build_target
-#endif
-
-/* CARES_PULL_SYS_TYPES_H is defined above when inclusion of header file  */
-/* sys/types.h is required here to properly make type definitions below.  */
-#ifdef CARES_PULL_SYS_TYPES_H
-#  include <sys/types.h>
-#endif
-
-/* CARES_PULL_SYS_SOCKET_H is defined above when inclusion of header file  */
-/* sys/socket.h is required here to properly make type definitions below.  */
-#ifdef CARES_PULL_SYS_SOCKET_H
-#  include <sys/socket.h>
-#endif
-
-/* Data type definition of ares_socklen_t. */
-
-#ifdef CARES_TYPEOF_ARES_SOCKLEN_T
-  typedef CARES_TYPEOF_ARES_SOCKLEN_T ares_socklen_t;
-#endif
-
-#endif /* __CARES_BUILD_H */

c-ares/ares_build.h.dist

+#ifndef __CARES_BUILD_H
+#define __CARES_BUILD_H
+
+
+/* Copyright (C) 2009 - 2010 by Daniel Stenberg et al
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted, provided
+ * that the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of M.I.T. not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission.  M.I.T. makes no representations about the
+ * suitability of this software for any purpose.  It is provided "as is"
+ * without express or implied warranty.
+ */
+
+/* ================================================================ */
+/*               NOTES FOR CONFIGURE CAPABLE SYSTEMS                */
+/* ================================================================ */
+
+/*
+ * NOTE 1:
+ * -------
+ *
+ * See file ares_build.h.in, run configure, and forget that this file
+ * exists it is only used for non-configure systems.
+ * But you can keep reading if you want ;-)
+ *
+ */
+
+/* ================================================================ */
+/*                 NOTES FOR NON-CONFIGURE SYSTEMS                  */
+/* ================================================================ */
+
+/*
+ * NOTE 1:
+ * -------
+ *
+ * Nothing in this file is intended to be modified or adjusted by the
+ * c-ares library user nor by the c-ares library builder.
+ *
+ * If you think that something actually needs to be changed, adjusted
+ * or fixed in this file, then, report it on the c-ares development
+ * mailing list: http://cool.haxx.se/mailman/listinfo/c-ares/
+ *
+ * Try to keep one section per platform, compiler and architecture,
+ * otherwise, if an existing section is reused for a different one and
+ * later on the original is adjusted, probably the piggybacking one can
+ * be adversely changed.
+ *
+ * In order to differentiate between platforms/compilers/architectures
+ * use only compiler built in predefined preprocessor symbols.
+ *
+ * This header file shall only export symbols which are 'cares' or 'CARES'
+ * prefixed, otherwise public name space would be polluted.
+ *
+ * NOTE 2:
+ * -------
+ *
+ * Right now you might be staring at file ares_build.h.dist or ares_build.h,
+ * this is due to the following reason: file ares_build.h.dist is renamed
+ * to ares_build.h when the c-ares source code distribution archive file is
+ * created.
+ *
+ * File ares_build.h.dist is not included in the distribution archive.
+ * File ares_build.h is not present in the git tree.
+ *
+ * The distributed ares_build.h file is only intended to be used on systems
+ * which can not run the also distributed configure script.
+ *
+ * On systems capable of running the configure script, the configure process
+ * will overwrite the distributed ares_build.h file with one that is suitable
+ * and specific to the library being configured and built, which is generated
+ * from the ares_build.h.in template file.
+ *
+ * If you check out from git on a non-configure platform, you must run the
+ * appropriate buildconf* script to set up ares_build.h and other local files.
+ *
+ */
+
+/* ================================================================ */
+/*  DEFINITION OF THESE SYMBOLS SHALL NOT TAKE PLACE ANYWHERE ELSE  */
+/* ================================================================ */
+
+#ifdef CARES_SIZEOF_LONG
+#  error "CARES_SIZEOF_LONG shall not be defined except in ares_build.h"
+   Error Compilation_aborted_CARES_SIZEOF_LONG_already_defined
+#endif
+
+#ifdef CARES_TYPEOF_ARES_SOCKLEN_T
+#  error "CARES_TYPEOF_ARES_SOCKLEN_T shall not be defined except in ares_build.h"
+   Error Compilation_aborted_CARES_TYPEOF_ARES_SOCKLEN_T_already_defined
+#endif
+
+#ifdef CARES_SIZEOF_ARES_SOCKLEN_T
+#  error "CARES_SIZEOF_ARES_SOCKLEN_T shall not be defined except in ares_build.h"
+   Error Compilation_aborted_CARES_SIZEOF_ARES_SOCKLEN_T_already_defined
+#endif
+
+/* ================================================================ */
+/*    EXTERNAL INTERFACE SETTINGS FOR NON-CONFIGURE SYSTEMS ONLY    */
+/* ================================================================ */
+
+#if defined(__DJGPP__) || defined(__GO32__)
+#  define CARES_SIZEOF_LONG           4
+#  define CARES_TYPEOF_ARES_SOCKLEN_T int
+#  define CARES_SIZEOF_ARES_SOCKLEN_T 4
+
+#elif defined(__SALFORDC__)
+#  define CARES_SIZEOF_LONG           4
+#  define CARES_TYPEOF_ARES_SOCKLEN_T int
+#  define CARES_SIZEOF_ARES_SOCKLEN_T 4
+
+#elif defined(__BORLANDC__)
+#  define CARES_SIZEOF_LONG           4
+#  define CARES_TYPEOF_ARES_SOCKLEN_T int
+#  define CARES_SIZEOF_ARES_SOCKLEN_T 4
+
+#elif defined(__TURBOC__)
+#  define CARES_SIZEOF_LONG           4
+#  define CARES_TYPEOF_ARES_SOCKLEN_T int
+#  define CARES_SIZEOF_ARES_SOCKLEN_T 4
+
+#elif defined(__WATCOMC__)
+#  define CARES_SIZEOF_LONG           4
+#  define CARES_TYPEOF_ARES_SOCKLEN_T int
+#  define CARES_SIZEOF_ARES_SOCKLEN_T 4
+
+#elif defined(__POCC__)
+#  define CARES_SIZEOF_LONG           4
+#  define CARES_TYPEOF_ARES_SOCKLEN_T int
+#  define CARES_SIZEOF_ARES_SOCKLEN_T 4
+
+#elif defined(__LCC__)
+#  define CARES_SIZEOF_LONG           4
+#  define CARES_TYPEOF_ARES_SOCKLEN_T int
+#  define CARES_SIZEOF_ARES_SOCKLEN_T 4
+
+#elif defined(__SYMBIAN32__)
+#  define CARES_SIZEOF_LONG           4
+#  define CARES_TYPEOF_ARES_SOCKLEN_T unsigned int
+#  define CARES_SIZEOF_ARES_SOCKLEN_T 4
+
+#elif defined(__MWERKS__)
+#  define CARES_SIZEOF_LONG           4
+#  define CARES_TYPEOF_ARES_SOCKLEN_T int
+#  define CARES_SIZEOF_ARES_SOCKLEN_T 4
+
+#elif defined(_WIN32_WCE)
+#  define CARES_SIZEOF_LONG           4
+#  define CARES_TYPEOF_ARES_SOCKLEN_T int
+#  define CARES_SIZEOF_ARES_SOCKLEN_T 4
+
+#elif defined(__MINGW32__)
+#  define CARES_SIZEOF_LONG           4
+#  define CARES_TYPEOF_ARES_SOCKLEN_T int
+#  define CARES_SIZEOF_ARES_SOCKLEN_T 4
+
+#elif defined(__VMS)
+#  define CARES_SIZEOF_LONG           4
+#  define CARES_TYPEOF_ARES_SOCKLEN_T unsigned int
+#  define CARES_SIZEOF_ARES_SOCKLEN_T 4
+
+#elif defined(__OS400__)
+#  if defined(__ILEC400__)
+#    define CARES_SIZEOF_LONG           4
+#    define CARES_TYPEOF_ARES_SOCKLEN_T socklen_t
+#    define CARES_SIZEOF_ARES_SOCKLEN_T 4
+#    define CARES_PULL_SYS_TYPES_H      1
+#    define CARES_PULL_SYS_SOCKET_H     1
+#  endif
+
+#elif defined(__MVS__)
+#  if defined(__IBMC__) || defined(__IBMCPP__)
+#    if defined(_ILP32)
+#      define CARES_SIZEOF_LONG           4
+#    elif defined(_LP64)
+#      define CARES_SIZEOF_LONG           8
+#    endif
+#    define CARES_TYPEOF_ARES_SOCKLEN_T socklen_t
+#    define CARES_SIZEOF_ARES_SOCKLEN_T 4
+#    define CARES_PULL_SYS_TYPES_H      1
+#    define CARES_PULL_SYS_SOCKET_H     1
+#  endif
+
+#elif defined(__370__)
+#  if defined(__IBMC__) || defined(__IBMCPP__)
+#    if defined(_ILP32)
+#      define CARES_SIZEOF_LONG           4
+#    elif defined(_LP64)
+#      define CARES_SIZEOF_LONG           8
+#    endif
+#    define CARES_TYPEOF_ARES_SOCKLEN_T socklen_t
+#    define CARES_SIZEOF_ARES_SOCKLEN_T 4
+#    define CARES_PULL_SYS_TYPES_H      1
+#    define CARES_PULL_SYS_SOCKET_H     1
+#  endif
+
+#elif defined(TPF)
+#  define CARES_SIZEOF_LONG           8
+#  define CARES_TYPEOF_ARES_SOCKLEN_T int
+#  define CARES_SIZEOF_ARES_SOCKLEN_T 4
+
+/* ===================================== */
+/*    KEEP MSVC THE PENULTIMATE ENTRY    */
+/* ===================================== */
+
+#elif defined(_MSC_VER)
+#  define CARES_SIZEOF_LONG           4
+#  define CARES_TYPEOF_ARES_SOCKLEN_T int
+#  define CARES_SIZEOF_ARES_SOCKLEN_T 4
+
+/* ===================================== */
+/*    KEEP GENERIC GCC THE LAST ENTRY    */
+/* ===================================== */
+
+#elif defined(__GNUC__)
+#  if defined(__i386__) || defined(__ppc__)
+#    define CARES_SIZEOF_LONG           4
+#  elif defined(__x86_64__) || defined(__ppc64__)
+#    define CARES_SIZEOF_LONG           8
+#  endif
+#  define CARES_TYPEOF_ARES_SOCKLEN_T socklen_t
+#  define CARES_SIZEOF_ARES_SOCKLEN_T 4
+#  define CARES_PULL_SYS_TYPES_H      1
+#  define CARES_PULL_SYS_SOCKET_H     1
+
+#else
+#  error "Unknown non-configure build target!"
+   Error Compilation_aborted_Unknown_non_configure_build_target
+#endif
+
+/* CARES_PULL_SYS_TYPES_H is defined above when inclusion of header file  */
+/* sys/types.h is required here to properly make type definitions below.  */
+#ifdef CARES_PULL_SYS_TYPES_H
+#  include <sys/types.h>
+#endif
+
+/* CARES_PULL_SYS_SOCKET_H is defined above when inclusion of header file  */
+/* sys/socket.h is required here to properly make type definitions below.  */
+#ifdef CARES_PULL_SYS_SOCKET_H
+#  include <sys/socket.h>
+#endif
+
+/* Data type definition of ares_socklen_t. */
+
+#ifdef CARES_TYPEOF_ARES_SOCKLEN_T
+  typedef CARES_TYPEOF_ARES_SOCKLEN_T ares_socklen_t;
+#endif
+
+#endif /* __CARES_BUILD_H */
 import sys
 import os
 import re
+import shutil
 import traceback
 from os.path import join, abspath, basename, dirname
 from glob import glob
 ares_embed = os.path.exists('c-ares')
 define_macros = []
 libraries = []
-ares_configure_command = [abspath('c-ares/configure'),
+ares_configure_command = ["/bin/sh", abspath('c-ares/configure'),
                           'CONFIG_COMMANDS=', 'CONFIG_FILES=']
 
 
                            ("EV_PERIODIC_ENABLE", '0')]
 
 
-def need_configure_ares():
-    if sys.platform == 'win32':
-        return False
-    if not os.path.exists('c-ares/ares_config.h'):
-        return True
-    if not os.path.exists('c-ares/ares_build.h'):
-        return True
-    if 'Generated from ares_build.h.in by configure' not in read('c-ares/ares_build.h', 100):
-        return True
-
-
 def make_universal_header(filename, *defines):
     defines = [('#define %s ' % define, define) for define in defines]
     lines = open(filename, 'r').read().split('\n')
     f.close()
 
 
-def configure_ares():
-    if need_configure_ares():
-        # restore permissions
-        os.chmod(ares_configure_command[0], 493)  # 493 == 0755
-        rc = os.system('cd c-ares && %s' % ' '.join(ares_configure_command))
+def configure_ares(bext, ext):
+    bdir = os.path.join(bext.build_temp, 'c-ares')
+    ext.include_dirs.insert(0, bdir)
+
+    if not os.path.isdir(bdir):
+        os.makedirs(bdir)
+
+    if sys.platform == "win32":
+        shutil.copy("c-ares\\ares_build.h.dist", os.path.join(bdir, "ares_build.h"))
+        return
+
+    cwd = os.getcwd()
+    try:
+        os.chdir(bdir)
+        if os.path.exists('ares_config.h') and os.path.exists('ares_build.h'):
+            return
+
+        rc = os.system(' '.join(ares_configure_command))
         if rc == 0 and sys.platform == 'darwin':
-            make_universal_header('c-ares/ares_build.h', 'CARES_SIZEOF_LONG')
-            make_universal_header('c-ares/ares_config.h', 'SIZEOF_LONG', 'SIZEOF_SIZE_T', 'SIZEOF_TIME_T')
+            make_universal_header('ares_build.h', 'CARES_SIZEOF_LONG')
+            make_universal_header('ares_config.h', 'SIZEOF_LONG', 'SIZEOF_SIZE_T', 'SIZEOF_TIME_T')
+    finally:
+        os.chdir(cwd)
 
 
 if ares_embed:
     ARES.sources += expand('c-ares/*.c')
+    ARES.configure = configure_ares
     if sys.platform == 'win32':
         ARES.libraries += ['advapi32']
         ARES.define_macros += [('CARES_STATICLIB', '')]
     else:
-        ARES.configure = configure_ares
         ARES.define_macros += [('HAVE_CONFIG_H', '')]
         if sys.platform != 'darwin':
             ARES.libraries += ['rt']
                 sys.exit(1)
         done.append(1)
 
+
 class sdist(_sdist):
     def run(self):
         make()
         _sdist.run(self)
 
+
 class my_build_ext(build_ext):
 
     def gevent_prepare(self, ext):
         make()
         configure = getattr(ext, 'configure', None)
         if configure:
-            configure()
+            configure(self, ext)
 
     def build_extension(self, ext):
         self.gevent_prepare(ext)
                         os.symlink(path_to_build_core_so, path_to_core_so)
                     else:
                         sys.stderr.write('Copying %s to %s\n' % (path_to_build_core_so, path_to_core_so))
-                        import shutil
                         shutil.copyfile(path_to_build_core_so, path_to_core_so)
         except Exception:
             traceback.print_exc()