Re: buildenv.pl/buildenv.bat - Mailing list pgsql-hackers

From Andrew Dunstan
Subject Re: buildenv.pl/buildenv.bat
Date
Msg-id 475C44B5.6090203@dunslane.net
Whole thread Raw
In response to Re: buildenv.pl/buildenv.bat  (Magnus Hagander <magnus@hagander.net>)
Responses Re: buildenv.pl/buildenv.bat  (Magnus Hagander <magnus@hagander.net>)
List pgsql-hackers

Magnus Hagander wrote:
>>
>> You seem to have misunderstood what I am suggesting. Of course we should
>> document use of buildenv.pl in addition to the hacky fix to the .bat
>> files. The hack is the part that would be invisible. The docs would be
>> visible and contain what would be our ongoing practice.
>>
>
> Correct, I was misunderstanding it :-)
>
> I still can't say I like that hack though. I'd rather document that you
> have to do it in the .bat file for docs + gui build.
>
> But it's better than what I thought you were proposing :-)
>
>
>

Well, I honestly think we can live with it for one cycle. As soon as 8.4
opens I'll get to work converting these .bat files to pure one line
wrappers.

Meanwhile, here's the proposed patch. If you want something else you'll
have to do it.

I don't know how many people regularly build on Windows other than you,
me and Dave.

cheers

andrew
Index: doc/src/sgml/install-win32.sgml
===================================================================
RCS file: /cvsroot/pgsql/doc/src/sgml/install-win32.sgml,v
retrieving revision 1.42
diff -c -r1.42 install-win32.sgml
*** doc/src/sgml/install-win32.sgml    28 Nov 2007 15:42:31 -0000    1.42
--- doc/src/sgml/install-win32.sgml    9 Dec 2007 19:31:36 -0000
***************
*** 58,69 ****
    Before you build, edit the file <filename>config.pl</filename> 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
!   <filename>buildenv.bat</filename> 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:
    <screen>
!    @ECHO OFF
!    SET PATH=%PATH%;c:\some\where\bison\bin
    </screen>
   </para>

--- 58,68 ----
    Before you build, edit the file <filename>config.pl</filename> 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
!   <filename>buildenv.pl</filename> 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:
    <screen>
!    $ENV{PATH}=$ENV{PATH} . ';c:\some\where\bison\bin';
    </screen>
   </para>

***************
*** 209,218 ****
      </userinput>
     </screen>
     To change the default build configuration to debug, put the following
!    in the <filename>buildenv.bat</filename> file:
     <screen>
      <userinput>
!      set CONFIG=Debug
      </userinput>
     </screen>
    </para>
--- 208,217 ----
      </userinput>
     </screen>
     To change the default build configuration to debug, put the following
!    in the <filename>buildenv.pl</filename> file:
     <screen>
      <userinput>
!      $ENV{CONFIG}="Debug";
      </userinput>
     </screen>
    </para>
***************
*** 263,269 ****
     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 <filename>buildenv.bat</filename> file. To run the tests, run one of
     the following commands from the <filename>src\tools\msvc</filename>
     directory:
     <screen>
--- 262,268 ----
     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 <filename>buildenv.pl</filename> file. To run the tests, run one of
     the following commands from the <filename>src\tools\msvc</filename>
     directory:
     <screen>
***************
*** 339,349 ****
       </para></listitem>
      </varlistentry>
     </variablelist>
!    Edit the <filename>buildenv.bat</filename> file, and add a variable for the
     location of the root directory, for example:
     <screen>
!     @ECHO OFF
!     SET DOCROOT=c:\docbook
     </screen>
     To build the documentation, run the command
     <filename>builddoc.bat</filename>. Note that this will actually run the
--- 338,347 ----
       </para></listitem>
      </varlistentry>
     </variablelist>
!    Edit the <filename>buildenv.pl</filename> file, and add a variable for the
     location of the root directory, for example:
     <screen>
!     $ENV{DOCROOT}='c:\docbook';
     </screen>
     To build the documentation, run the command
     <filename>builddoc.bat</filename>. Note that this will actually run the
Index: src/tools/msvc/builddoc.bat
===================================================================
RCS file: /cvsroot/pgsql/src/tools/msvc/builddoc.bat,v
retrieving revision 1.5
diff -c -r1.5 builddoc.bat
*** src/tools/msvc/builddoc.bat    17 Mar 2007 14:01:01 -0000    1.5
--- src/tools/msvc/builddoc.bat    9 Dec 2007 19:31:36 -0000
***************
*** 1,5 ****
  @echo off
! REM Adjust path for your docbook installation in buildenv.bat

  REM $PostgreSQL: pgsql/src/tools/msvc/builddoc.bat,v 1.5 2007/03/17 14:01:01 mha Exp $

--- 1,5 ----
  @echo off
! REM Adjust path for your docbook installation in buildenv.pl

  REM $PostgreSQL: pgsql/src/tools/msvc/builddoc.bat,v 1.5 2007/03/17 14:01:01 mha Exp $

***************
*** 10,16 ****

  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 %DOCROOT%\%OPENJADE% SET NF=OpenJade
  IF NOT EXIST %DOCROOT%\docbook SET NF=docbook
--- 10,21 ----

  IF EXIST ..\msvc IF EXIST ..\..\..\src cd ..\..\..
  IF NOT EXIST doc\src\sgml\version.sgml goto noversion
!
! 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
Index: src/tools/msvc/install.bat
===================================================================
RCS file: /cvsroot/pgsql/src/tools/msvc/install.bat,v
retrieving revision 1.2
diff -c -r1.2 install.bat
*** src/tools/msvc/install.bat    26 Jun 2007 11:43:56 -0000    1.2
--- src/tools/msvc/install.bat    9 Dec 2007 19:31:36 -0000
***************
*** 13,19 ****
  :RUN_INSTALL

  SETLOCAL
! if exist buildenv.bat call buildenv.bat

  perl install.pl "%1"

--- 13,24 ----
  :RUN_INSTALL

  SETLOCAL
!
! 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"

Index: src/tools/msvc/pgbison.bat
===================================================================
RCS file: /cvsroot/pgsql/src/tools/msvc/pgbison.bat,v
retrieving revision 1.7
diff -c -r1.7 pgbison.bat
*** src/tools/msvc/pgbison.bat    7 Jul 2007 07:43:21 -0000    1.7
--- src/tools/msvc/pgbison.bat    9 Dec 2007 19:31:36 -0000
***************
*** 1,7 ****
  @echo off
  REM $PostgreSQL: pgsql/src/tools/msvc/pgbison.bat,v 1.7 2007/07/07 07:43:21 mha Exp $

! if exist src\tools\msvc\buildenv.bat call src\tools\msvc\buildenv.bat

  SET BV=
  for /F "tokens=4 usebackq" %%f in (`bison -V`) do if "!BV!"=="" SET BV=%%f
--- 1,11 ----
  @echo off
  REM $PostgreSQL: pgsql/src/tools/msvc/pgbison.bat,v 1.7 2007/07/07 07:43:21 mha Exp $

! 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
Index: src/tools/msvc/pgflex.bat
===================================================================
RCS file: /cvsroot/pgsql/src/tools/msvc/pgflex.bat,v
retrieving revision 1.4
diff -c -r1.4 pgflex.bat
*** src/tools/msvc/pgflex.bat    17 Mar 2007 14:01:01 -0000    1.4
--- src/tools/msvc/pgflex.bat    9 Dec 2007 19:31:36 -0000
***************
*** 1,7 ****
  @echo off
  REM $PostgreSQL: pgsql/src/tools/msvc/pgflex.bat,v 1.4 2007/03/17 14:01:01 mha Exp $

! if exist src\tools\msvc\buildenv.bat call src\tools\msvc\buildenv.bat

  flex -V > NUL
  if errorlevel 1 goto noflex
--- 1,11 ----
  @echo off
  REM $PostgreSQL: pgsql/src/tools/msvc/pgflex.bat,v 1.4 2007/03/17 14:01:01 mha Exp $

! 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

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: whats the deal with -u ?
Next
From: Bruce Momjian
Date:
Subject: Re: Release Note Changes