|
1 | 1 | #!/usr/bin/env python |
2 | 2 |
|
3 | | -include_dirs=['/usr/include/pgsql'] |
4 | | -library_dirs=['usr/lib/pgsql'] |
5 | | -optional_libs=['pq'] |
6 | | - |
7 | 3 | # Setup script for the PyGreSQL version 3 |
8 | 4 | # created 2000/04 Mark Alexander <mwa@gate.net> |
9 | 5 | # tweaked 2000/05 Jeremy Hylton <jeremy@cnri.reston.va.us> |
| 6 | +# win32 support 2001/01 Gerhard Haering <gerhard@bigfoot.de> |
10 | 7 |
|
11 | 8 | # requires distutils; standard in Python 1.6, otherwise download from |
12 | 9 | # http://www.python.org/sigs/distutils-sig/download.html |
|
22 | 19 | # on using distutils to install Python programs. |
23 | 20 |
|
24 | 21 | from distutils.core import setup |
| 22 | +import sys |
| 23 | + |
| 24 | +if sys.platform == "win32": |
| 25 | + # If you want to build from source; you must have built a win32 native libpq # before and copied libpq.dll into the PyGreSQL root directory. |
| 26 | + win_pg_build_root = 'd:/dev/pg/postgresql-7.0.2/' |
| 27 | + include_dirs=[ win_pg_build_root + 'src/include', win_pg_build_root + '/src/include/libpq', win_pg_build_root + 'src', win_pg_build_root + 'src/interfaces/libpq' ] |
| 28 | + library_dirs=[ win_pg_build_root + 'src/interfaces/libpq/Release' ] |
| 29 | + optional_libs=[ 'libpqdll', 'wsock32', 'advapi32' ] |
| 30 | + data_files = [ 'libpq.dll' ] |
| 31 | +else: |
| 32 | + include_dirs=['/usr/include/pgsql'] |
| 33 | + library_dirs=['usr/lib/pgsql'] |
| 34 | + optional_libs=['pq'] |
| 35 | + data_files = [] |
25 | 36 |
|
26 | 37 | setup (name = "PyGreSQL", |
27 | 38 | version = "3.1", |
|
32 | 43 | licence = "Python", |
33 | 44 |
|
34 | 45 | py_modules = ['pg', 'pgdb'], |
35 | | - ext_modules = [ ('_pgmodule', { |
| 46 | + ext_modules = [ Extension( |
| 47 | + name='_pg', |
36 | 48 | 'sources': ['pgmodule.c'], |
37 | 49 | 'include_dirs': include_dirs, |
38 | 50 | 'library_dirs': library_dirs, |
39 | 51 | 'libraries': optional_libs |
40 | | - } |
41 | 52 | )] |
| 53 | + data_files = data_files |
42 | 54 | ) |
43 | 55 |
|
0 commit comments