From 9b39d6eeb6ad2eb860c15b5401b995bf4e74d640 Mon Sep 17 00:00:00 2001 From: Hiroshi Inoue Date: Tue, 4 Oct 2016 13:20:27 +0900 Subject: [PATCH] Using Powershell and MSBuild is the recommended way. --- docs/frame_adjust.js | 22 +++++++++ docs/win32-compilation.html | 38 ++++++++------- winbuild/readme.txt | 92 +++++++++++++++++++++---------------- 3 files changed, 93 insertions(+), 59 deletions(-) create mode 100644 docs/frame_adjust.js diff --git a/docs/frame_adjust.js b/docs/frame_adjust.js new file mode 100644 index 0000000..e06ec3f --- /dev/null +++ b/docs/frame_adjust.js @@ -0,0 +1,22 @@ + diff --git a/docs/win32-compilation.html b/docs/win32-compilation.html index 0c28d03..bf1bf6b 100644 --- a/docs/win32-compilation.html +++ b/docs/win32-compilation.html @@ -1,8 +1,8 @@ - - + Compiling psqlODBC on Windows + @@ -32,6 +32,10 @@ The following 3rd party software are required for the build:

+

Building with Powershell and MSBuild

+ + +

Building with nmake.exe

Use NMAKE.exe to build the driver for the currently active target:

@@ -112,30 +116,24 @@ by creating a file called "windows-local.mak".
  • If MSDTC is enabled, ANSI_VERSION also creates "pgenlista.dll", or UNICODE creates "pgenlist.dll".
  • -

    Building with MSBuild

    -This is a recommendation method in recent environment where Powershell is included as standard equipment and installed Visual C++ is VC10 or later. -
    In fact the binaries of official release are built using this method. - -

    -Use Powershell.exe or Powershell Prompt to build the driver:

    +

    IDE Method

    - C:\psqlodbc\winbuild\> (Powershell) BuildAll.ps1 <options>

    - -

    -By default, BuildAll.ps1 builds all the dlls at once.
    -Note that neither Microsoft Windows SDK Command Prompt nor Visual Studio Command Prompt is needed.
    -(See win32_compilation_using_MSBuild.txt for details.) +

    A Microsoft Visual Studio project file (and workspace) is included in the source tree. +

    -

    -

    -To build the .msi installer file:

    +

    psqlodbc.dsp + can be used with Microsoft Visual C++ 6.0. +

    - C:\psqlodbc\installer\> (Powershell) buildInstallers.ps1 <optios>

    +

    psqlodbc.proj and +psqlodbc.sln +can be used with Microsoft Visual C++ 2005 Edition (including the Express edition which can be downloaded free of charge from http://msdn.microsoft.com/vstudio/express/visualc/usingpsdk/default.aspx) +

    -By default, buildInstallers.ps1 builds bootstrapper program psqlodbc-setup.exe together. - + Preparation before the build: +

    1. The Windows distribution of PostgreSQL will install the required headers and libraries into C:\Program Files\PostgreSQL\9.2
    2. OpenSSL should be installed into C:\OpenSSL (OpenSSL binaries can be downloaded from http://www.slproweb.com/products/Win32OpenSSL.html) diff --git a/winbuild/readme.txt b/winbuild/readme.txt index 321cd72..12c4d17 100755 --- a/winbuild/readme.txt +++ b/winbuild/readme.txt @@ -1,17 +1,24 @@ -/******************************************************************** - - Development using Powershell and MSBuild instead of Batch and Nmake + Using Powershell and MSBuild is recommended. + In fact the binaries of official release are built using this mothod. Currently 4 Windows Powershell scripts are provided for developpers. - BuildAll.ps1 - build all dlls for psqlodbc using MSBuild. - editConfiguration.ps1 - a GUI tool to set Build environment - regress.ps1 - build regression test programs and run - buildInstallers.ps1 - build installers(.msi or setup.exe) + winbuild/BuildAll.ps1 - build all dlls for psqlodbc drivers using + MSBuild. + winbuild/editConfiguration.ps1 - a GUI tool to set Build environment + winbuild/regress.ps1 - build regression test programs and run + installer/buildInstallers.ps1 - build installers(.msi or setup.exe) + + Use Powershell console or Command Prompt to invoke scripts: + + For example, to build the driver: - You can invoke these scripts from Powershell console or you can also - use the same functionality from Command prompt using Windows helper - batch at the parent folder (..\). See ..\readme_winbuild.txt. + C:\psqlodbc\winbuild\> (Powershell) ./BuildAll.ps1 + + or you can use the same functionality from Command Prompt using Windows + helper batch at the parent folder (..\). See ..\readme_winbuild.txt. + + C:\psqlodbc\> (Commnd Prompt) .\BuildAll.bat 1. Please start a powershell console and set the ExecutionPolicy of Powershell to RemoteSigned or Unrestricted. @@ -74,18 +81,7 @@ Get-Help .\BuildAll(.ps1) [-Detailed | -Examples | -Full] - 5. Regression test - - Please type - - .\regress(.ps1) - - By default, build 32-bit binaries from test sources and run the tests. - If you'd like to test 64-bit version, please type - - .\regress(.ps1) -p(latform) x64 - - 6. Outputs + 5. Outputs of Build The build can produce output in up to four directories for each of the debug and release configurations: @@ -100,29 +96,47 @@ pgxalib.dll is only built for the multibyte/unicode version, as it is the same for both unicode and ansi drivers. + + 6. How to use drivers. - Dependencies like libpq etc are not copied into the build - output directories. You must copy them to the target directory yourself. - Dependency Walker (depends.exe) from http://dependencywalker.com/ can help - you find what's needed, but in general you'll need to add: + You can't use psqlodbc drivers at once you build the drivers. + Usually you have to install drivers using installers made by + installer/buildInstallers.ps1. buildInstallers.ps1 bundles + libpq and related libraries like ssleay32, libeay32 from the + PostgreSQL bin directory and MSVC runtime libraries compiled with. - - libpq (from the PostgreSQL bin dir) - - ssleay32 (from the PostgreSQL bin dir) - - libeay32 (from the PostgreSQL bin dir) - - libintl (from the PostgreSQL bin dir) + However, it is painful for developers to build binaries, build + installers and install each time the source files are changed. + It is recommended to use a special installation-less driver + (postgres_devw) registered by regress.ps1 - ... and the Visual Studio runtime redist for the version of Visual Studio - you compiled with. + 7. Regression test in place - 7. Installer + After BuildAll(.ps1), please type - See ..\installers\README.txt. + .\regress(.ps1) -Troubleshooting: + You have to neither install nor copy binaries. + By default, build 32-bit binaries from test sources and run the tests. + If you'd like to test 64-bit version, please type -Some documentation on dealing with Windows SDK installation issues can be found -on the related pg_build_win page: -https://github.com/2ndQuadrant/pg_build_win#troubleshooting + .\regress(.ps1) -p(latform) x64 + + 8. Installer + To build the .msi installer file: + + C:\psqlodbc\installer\> (Powershell) ./buildInstallers.ps1 + or + C:\psqlodbc\> (Command Prompt) .\buildInstallers.bat + + By default, buildInstallers.ps1 builds bootstrapper program + psqlodbc-setup.exe together. + + See ../installer/readme.txt in the source directory for details. + +Troubleshooting: -***********************************************************************/ + Some documentation on dealing with Windows SDK installation issues + can be found on the related pg_build_win page: + https://github.com/2ndQuadrant/pg_build_win#troubleshooting -- 2.39.5