From: Magnus Hagander Date: Wed, 19 Dec 2007 12:29:36 +0000 (+0000) Subject: Make all msvc build scripts use buildenv.pl, not buildenv.bat. X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=9e609523e05a722c6552a847512205dd925e59ba;p=users%2Fbernd%2Fpostgres.git Make all msvc build scripts use buildenv.pl, not buildenv.bat. Andrew Dunstan --- diff --git a/doc/src/sgml/install-win32.sgml b/doc/src/sgml/install-win32.sgml index 86c2d71b93..feed3df7c8 100644 --- a/doc/src/sgml/install-win32.sgml +++ b/doc/src/sgml/install-win32.sgml @@ -58,12 +58,11 @@ Before you build, edit the file config.pl to reflect the configuration options you want set, including the paths to libraries used. If you need to set any other environment variables, create a file called - buildenv.bat and put the required commands there. For + buildenv.pl and put the required commands there. For example, to add the path for bison when it's not in the PATH, create a file containing: - @ECHO OFF - SET PATH=%PATH%;c:\some\where\bison\bin + $ENV{PATH}=$ENV{PATH} . ';c:\some\where\bison\bin'; @@ -209,10 +208,10 @@ To change the default build configuration to debug, put the following - in the buildenv.bat file: + in the buildenv.pl file: - set CONFIG=Debug + $ENV{CONFIG}="Debug"; @@ -263,7 +262,7 @@ required parts first. Also, make sure that the DLLs required to load all parts of the system (such as the Perl and Python DLLs for the procedural languages) are present in the system path. If they are not, set it through - the buildenv.bat file. To run the tests, run one of + the buildenv.pl file. To run the tests, run one of the following commands from the src\tools\msvc directory: @@ -339,11 +338,10 @@ - Edit the buildenv.bat file, and add a variable for the + Edit the buildenv.pl file, and add a variable for the location of the root directory, for example: - @ECHO OFF - SET DOCROOT=c:\docbook + $ENV{DOCROOT}='c:\docbook'; To build the documentation, run the command builddoc.bat. Note that this will actually run the diff --git a/src/tools/msvc/builddoc.bat b/src/tools/msvc/builddoc.bat index 04d490e0aa..e225a656fd 100755 --- a/src/tools/msvc/builddoc.bat +++ b/src/tools/msvc/builddoc.bat @@ -1,5 +1,5 @@ @echo off -REM Adjust path for your docbook installation in buildenv.bat +REM Adjust path for your docbook installation in buildenv.pl REM $PostgreSQL$ @@ -10,7 +10,12 @@ SET DSSSL=docbook-dsssl-1.79 IF EXIST ..\msvc IF EXIST ..\..\..\src cd ..\..\.. IF NOT EXIST doc\src\sgml\version.sgml goto noversion -IF EXIST src\tools\msvc\buildenv.bat CALL src\tools\msvc\buildenv.bat + +IF NOT EXIST src\tools\msvc\buildenv.pl goto nobuildenv +perl -e "require 'src/tools/msvc/buildenv.pl'; while(($k,$v) = each %ENV) { print qq[\@SET $k=$v\n]; }" > bldenv.bat +CALL bldenv.bat +del bldenv.bat +:nobuildenv IF NOT EXIST %DOCROOT%\%OPENJADE% SET NF=OpenJade IF NOT EXIST %DOCROOT%\docbook SET NF=docbook diff --git a/src/tools/msvc/install.bat b/src/tools/msvc/install.bat index 4a7fffa908..15f1560e9d 100644 --- a/src/tools/msvc/install.bat +++ b/src/tools/msvc/install.bat @@ -13,7 +13,12 @@ exit /b 1 :RUN_INSTALL SETLOCAL -if exist buildenv.bat call buildenv.bat + +IF NOT EXIST buildenv.pl goto nobuildenv +perl -e "require 'buildenv.pl'; while(($k,$v) = each %ENV) { print qq[\@SET $k=$v\n]; }" > bldenv.bat +CALL bldenv.bat +del bldenv.bat +:nobuildenv perl install.pl "%1" diff --git a/src/tools/msvc/pgbison.bat b/src/tools/msvc/pgbison.bat index dcd6fd4ec4..b7ba958a02 100755 --- a/src/tools/msvc/pgbison.bat +++ b/src/tools/msvc/pgbison.bat @@ -1,7 +1,11 @@ @echo off REM $PostgreSQL$ -if exist src\tools\msvc\buildenv.bat call src\tools\msvc\buildenv.bat +IF NOT EXIST src\tools\msvc\buildenv.pl goto nobuildenv +perl -e "require 'src/tools/msvc/buildenv.pl'; while(($k,$v) = each %ENV) { print qq[\@SET $k=$v\n]; }" > bldenv.bat +CALL bldenv.bat +del bldenv.bat +:nobuildenv SET BV= for /F "tokens=4 usebackq" %%f in (`bison -V`) do if "!BV!"=="" SET BV=%%f diff --git a/src/tools/msvc/pgflex.bat b/src/tools/msvc/pgflex.bat index 709f9aaa62..fce859a67f 100755 --- a/src/tools/msvc/pgflex.bat +++ b/src/tools/msvc/pgflex.bat @@ -1,7 +1,11 @@ @echo off REM $PostgreSQL$ -if exist src\tools\msvc\buildenv.bat call src\tools\msvc\buildenv.bat +IF NOT EXIST src\tools\msvc\buildenv.pl goto nobuildenv +perl -e "require 'src/tools/msvc/buildenv.pl'; while(($k,$v) = each %ENV) { print qq[\@SET $k=$v\n]; }" > bldenv.bat +CALL bldenv.bat +del bldenv.bat +:nobuildenv flex -V > NUL if errorlevel 1 goto noflex