Обсуждение: Win32 port diff files

Поиск
Список
Период
Сортировка

Win32 port diff files

От
Jan Wieck
Дата:

--
#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me.                                  #
#================================================== JanWieck@Yahoo.com #
How to compile this Win32 port

1) Requirements and 1-time settings:

1.1) Visual C++

    You need VC++ 6.0 on ServicePack 5.

1.2) Tools

    The project uses some unix tools which are part of the cygwin
    distribution. You need to have

    - bison
    - flex
    - sed
    - touch

    in your path. This path must also be added to the VC++ options.

        Tools->Options
        Directories Tab - Executable Files

    The bison.simple must be in \usr\share\bison on
    the same drive where you will put the PostgreSQL sources.

1.1) Tcl

    The port builds the Tcl client library for Windows. Therefore, the
    headers and libs for Tcl are required. I used ActiveState Tcl
    version 8.3.4.1.

    The Tcl installations lib and include directories must be added to
    the VC++ options.

    Tools-Options
        Directories Tab - Library Files and Include Files



2) The build process

2.1) Work on Unix

    Extract a postgresql-7.2.1.tar.gz distribution. Cd into the
    postgresql-7.2.1 directory and apply the two patches with the
    command:

        patch -p1 -Els <....path_to_patch_file

2.2) Convert CR to CRLF

    I used zip/unzip while copying the sourcetree onto a mounted
    windows share ... MS VC++ is really picky about line-endings.

2.3) Build on Windows

    - cd to "src\win32_support"
    - execute "pre_build.bat"
    - open "src\postgres.dsw" in MS VC++
    - change to "FileView"
    - set "all files" as active project
    - select "Build->Clean" to remove prebuilt files from the
      distribution.
    - select "Build->Compile"

    The result is build into a directory Debug_Install or Release_Install
    at the same level of src (depending on the build type).

3) Using the database

3.1) Set environment variables:

    PGHOME=<the above ..._Install directory>
    PGDATA=%PGHOME%\data
    PGLIB=%PGHOME%\lib
    PGHOST=localhost
    PATH=%PGHOME%\bin

3.2) Initialize DB and start postmaster

    In a command prompt run "initdb" and "postmaster"

3.3) Congrats

    If you got this far, you have a running native Win32 port of
    PostgreSQL v7.2.1.



4) Notes

    Unfortunately the cygwin bash does not like our regression test
    script for Windows. We used a MKS korn shell at PeerDirect. With
    that the regression test passes all 78 tests.

    The bki file used during initdb has been built on Linux and is
    not updated/built on Windows. Same for the fmgrtab.c and
    fmgroids.h files.

    The postgres.def file is not built.




Вложения