summaryrefslogtreecommitdiff
path: root/setup_windows.py
diff options
context:
space:
mode:
authorEvax Software <contact@evax.fr>2012-10-04 13:34:39 -0400
committerfarcepest <farcepest@gmail.com>2012-10-04 13:34:39 -0400
commit7a846cf5e35ebcad852309aebaa0bac8a7244744 (patch)
tree4fbd759ae4894cabcd590e15e61b535766a13ee2 /setup_windows.py
parent0164ffeb2534f050148348e50a51641491b6a65d (diff)
downloadmysqldb1-7a846cf5e35ebcad852309aebaa0bac8a7244744.tar.gz
Allow pip install from git
Merged with modifications from https://github.com/evax/MySQLdb1/commit/a8152690101733904b16a32ff8467220ca07242c
Diffstat (limited to 'setup_windows.py')
-rw-r--r--setup_windows.py46
1 files changed, 46 insertions, 0 deletions
diff --git a/setup_windows.py b/setup_windows.py
new file mode 100644
index 0000000..ffe6397
--- /dev/null
+++ b/setup_windows.py
@@ -0,0 +1,46 @@
+import os, sys
+
+def get_config():
+ from setup_common import get_metadata_and_options, enabled, create_release_file
+
+ metadata, options = get_metadata_and_options()
+
+ connector = options["connector"]
+
+ extra_objects = []
+
+ if enabled(options, 'embedded'):
+ client = "mysqld"
+ else:
+ client = "mysqlclient"
+
+ library_dirs = [ os.path.join(connector, r'lib\opt') ]
+ libraries = [ 'kernel32', 'advapi32', 'wsock32', client ]
+ include_dirs = [ os.path.join(connector, r'include') ]
+ extra_compile_args = [ '/Zl' ]
+
+ name = "MySQL-python"
+ if enabled(options, 'embedded'):
+ name = name + "-embedded"
+ metadata['name'] = name
+
+ define_macros = [
+ ('version_info', metadata['version_info']),
+ ('__version__', metadata['version']),
+ ]
+ create_release_file(metadata)
+ del metadata['version_info']
+ ext_options = dict(
+ name = "_mysql",
+ library_dirs = library_dirs,
+ libraries = libraries,
+ extra_compile_args = extra_compile_args,
+ include_dirs = include_dirs,
+ extra_objects = extra_objects,
+ define_macros = define_macros,
+ )
+ return metadata, ext_options
+
+if __name__ == "__main__":
+ sys.stderr.write("""You shouldn't be running this directly; it is used by setup.py.""")
+