From: Gerhard H?r. <gha...@us...> - 2001-10-05 23:01:01
|
Update of /cvsroot/pypgsql/pypgsql In directory usw-pr-cvs1:/tmp/cvs-serv21818 Modified Files: README Added Files: README.win32 Log Message: 06OCT2001 gh Added complete instructions for building PostgreSQL's libpq and pyPgSQL natively on Windows. Moved that information into a separate file README.win32. --- NEW FILE: README.win32 --- #ident "@(#) $Id: README.win32,v 1.1 2001/10/05 23:00:58 ghaering Exp $" Information about pyPgSQL development and use on Windows operating systems ========================================================================== by Gerhard Haering (ge...@bi...) 1. Warning ========== pyPgSQL uses the libpq client library of PostgreSQL. On Windows, however, this library isn't as stable as it is on Unix. The good news is that the stability is improving. Version 7.2 of PostgreSQL will have better win32 support than previous versions. For this reason, the binary win32 versions of pyPgSQL that we provide are already built against the PostgreSQL 7.2 development version. 2. Compiling PostgreSQL's libpq client library ============================================== 2.1 With Visual C++ ------------------- This is described in the chapter "Installation on Windows" in the PostgreSQL documentation: in a shell, change into the src directory of your PostgreSQL source tree and issue "nmake -f win32.mak". 2.2 With gcc ------------ Building with gcc isn't supported by the vanilla PostgreSQL sources at the moment, but is still possible. First, you need to install a gcc capable of creating Windows binaries. Install the appropriate packages from the mingw32 project or from Cygwin. I maintain Makefiles for compiling libpq with mingw32. You can look at my home page for them (http://www.cs.fhm.edu/~ifw00065/) or ask me via email. 3. Building pyPgSQL =================== 3.1 Adjust setup.py ------------------- 3.1.1 For Visual C++ - Adjust win_pg_build_root to point to your PostgreSQL source tree - Change library_dirs to library_dirs = [win_pg_build_root + "src/interfaces/libpq/Release"] - Change this line: optional_libs += ["pqdll"] to: optional_libs += ["libpqdll"] - copy the libpq.dll file from the PostgreSQL source tree to the pyPgSQL root directory 3.1.2 For gcc (mingw32) - Adjust win_pg_build_root to point to your PostgreSQL source tree - Change this line: optional_libs += ["pqdll"] to: optional_libs += ["pq"] if you want to link against PostgreSQL's libpq statically - copy the libpq.dll file from the PostgreSQL source tree to the pyPgSQL root directory, but if you want to link statically against PostgreSQL's libpq, change the following line instead: data_files = ["libpq.dll"] to: data_files = [] 3.2 Building ------------ Now that you've prepared everything, you can build pyPgSQL with $ python setup.py build # Visual C++ or $ python setup.py build --compiler=mingw32 # gcc/mingw32 install it with $ python setup.py install and create an installer with $ python setup.py bdist_wininst Remarks: - The "install" and bdist_wininst commands imply "build" - If you have installed Cygwin's Python, you need to provide the full path to the native win32 Python you want to use; I prefer to have a copy of the win32 Python under an alternative name like ntpython in my PATH Index: README =================================================================== RCS file: /cvsroot/pypgsql/pypgsql/README,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** README 2001/10/01 01:42:41 1.14 --- README 2001/10/05 23:00:55 1.15 *************** *** 121,151 **** local system administrator. - 1.3.1 Platform specific notes - ----------------------------- - - Windows: (Thanks to Gerhard Haering <ge...@bi...> for this information) - - To compile the C sources, you'll need a compiler that supports the "long - long" type. Microsoft Visual C++ doesn't work for this reason. The GNU - compilers are known to work. - - "python setup.py --compiler=mingw32" will build with the native win32 mode - of the GNU compiler. - - Current versions of the GNU tools on Windows don't include the functions - strtoll, strtoull and strtok_r. You'll need these to compile successfully. - strtok.c and modified (to compile under the cygwin) versions of strtoll.c - and strtoull.c from the FreeBSD CVS have been added to the pyPgSQL source - tree. You can download the original files from the following URL: - - http://www.freebsd.org/cgi/cvsweb.cgi/src/lib/libc/stdlib/ - - To successfully compile on Windows, you'll need a fairly recent PostgreSQL - version: version 7.1.2 plus the update for the file - src/interfaces/libpq/libpqdll.def from CVS. - - There are still some stability issues with libpq on Windows. Hopefully - these will be fixed in the PostgreSQL 7.2 release. - 1.4 Testing the PgSQL module. ----------------------------- --- 121,124 ---- |