# The contents of this file are subject to the Interbase Public
# License Version 1.0 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy
# of the License at http://www.Inprise.com/IPL.html
#
# Software distributed under the License is distributed on an
# "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express
# or implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code was created by Inprise Corporation
# and its predecessors. Portions created by Inprise Corporation are
# Copyright (C) Inprise Corporation.
#
# All Rights Reserved.
# Contributor(s): ______________________________________.

This document gives some information about the InterBase product
build on Windows/NT platforms.

Created: 14-Aug-2000, bsriram
Modification History: 
   18-Aug-2000, bsriram: Added some more comments from an old Build doc.
         
-------------------------------------------------------------------------------
*** How to build an InterBase kit on a Windows platform ***

Setting up a build environment on Windows NT
********************************************
This document outlines how to setup a build environment on Windows NT 
(this process may work on Windows 95/98 but is not supported). This document 
assumes that you will be building InterBase 6.0. While it may be stylish 
to install the latest of all the software listed (i.e. C++ Builder instead 
of BC), it WILL NOT be supported in anyway (and quite frankly, 
probably won't work). Also, until you are familiar with the build process, 
DO NOT MODIFY ANY BUILD SCRIPTS. Note that this process is only valid for 
building the SUPERSERVER version of InterBase.  

Before starting:
---------------
Before you can build on Windows NT, you need to have the following installed 
and working on your machine. When installing the software, your life will be 
much easier if you do not have spaces in the path names 

- Microsoft Visual C++ 5.0 Service Pack 3 (including MFC) 
- MKS Toolkit (any version) 
- Borland BC 5.02   (command line tools, visual tools, and libraries) 
- Latest shipping InterBase kit 
Also, if you have enough disk space you may want to consider installing the 
documentation for VisualC++ as it includes parts of the Windows SDK. 

After installing InterBase on your machine, move GDS32.DLL from the 
Winnt\System32 directory to your InterBase\Bin directory. 

Note on installing MKS: 
    MKS toolkit will default to installing in the root of c:\.  
    While this is not a problem, you may want to put it in its own directory, 
    for example, c:\mks. This will help keep your machine from getting too 
    cluttered. Also, you will only need to install the command line tools.

Changes to make:
----------------
Once all of the software is installed, you need to add the following 
environment variables to your system. 

NOTE:  To change the environment variables right-click on 'My Computer' 
and choose Properties. Then click the Environment tab.
  
Env Variable    Value 
---------------------------------------------

IBSERVER        path to the Interbase directory (i.e. location of isc4.gdb)
TOOLPATH        path to Borland\bin directory (i.e. location of Borland Compilers.EXE)
ISC_USER        your username for connecting to InterBase servers (NOT SYSDBA)
ISC_PASSWORD    your password to match the username above

The username and password that you specify above will need to exist in the 
security database on both your local machine and on yoda. If the username 
you pick does not exist in either place you will need to add it using GSEC. 

You will also need to rename the following files: 
 \mks\mksnt\echo.exe        ->        \mks\mksnt\mks_echo.exe 
 \mks\mksnt\make.exe        ->        \mks\mksnt\mks_make.exe 
Your PATH environment variable must include the following directories 
(assuming everything is installed to C:) 

  c:\<visual C>\bin 
  c:\<borland>\bin 
  c:\<mks>\mksnt 
  c:\<interbase>\bin 

The good news is most (except for Delphi and InterBase) do this for you. 
This means that you will need to reboot your machine once the software 
is installed in order to update your environment. 

Pre-requisites:
##############
	- An installed InterBase kit in the build machine.
	  This will allow us to use 'gpre', include and library 
	  files from the InterBase SDK directory.
	  You can download an InterBase runtime kit from the 
	  following site: http://www.inprise.com/interbase
	- Disk space: around 200 MB
	- Download the source tree from the CVS repository in 
	  SourceForge under the project Interbase. Further details
	  on the project can be obtained at 
	  http://www.sourceforge.net/project/Interbase
	- 'make' utility from Borland C++ 5.0
	- Microsoft Visual C++ compiler
	- MKS Shell toolkit. You could also try using 'bash', but
	  'bash' has not been tested with the test builds.
	  This will allow shell scripts to be executed as part of
	  build procedure.
	- Each component in the source tree has a file defining
	  dependencies for the 'make' process. This file is 
	  depends.mak. In order to make use of this file during the
	  build process, please define the following environment
	  variable.
	  export INCLUDE_DEPENDS_MAK='yes'

Assumptions:
############
	- You are logged into the 'build' machine for the respective
	  platform. 
	- platform for build is Windows NT
	- Let us call the InterBase Runtime kit installed directory 
	  as INTERBASE_RUNTIME
	- Let us call the local InterBase CVS source tree directory
	  as LOCAL_CVS_SOURCE_TREE
	- Start the Interbase runtime server 
	- Include '.' in your $PATH (in order to execute scripts in
	                             in the current directory)

Actions to be followed:
######################
	- cd $LOCAL_CVS_SOURCE_TREE
	- setup_dirs.ksh
	  /* This script does setup of the directories required for 
	     the build to proceed effectively. 
	     If you see some errors w.r.t. the 'register' component,
	     please ignore them for now. They cause no harm */

	- cd $INTERBASE_RUNTIME
	- cp SDK/include/iberror.h $LOCAL_CVS_SOURCE_TREE/interbase/include
	- cp SDK/include/iberror.h $LOCAL_CVS_SOURCE_TREE/ib_debug/include
	- cp SDK/lib_ms/gds32_ms.lib $LOCAL_CVS_SOURCE_TREE/jrd/ms_obj/client
	- cp SDK/lib_ms/gds32_ms.lib $LOCAL_CVS_SOURCE_TREE/jrd/ms_obj/clientd
	  /* The above is basically to copy the necessary files into DEV
	     and PROD trees. */

	- cd $LOCAL_CVS_SOURCE_TREE
	- cd jrd
	- make -f makefile.lib -DCLIENT -DDEV codes.exe
	- codes.exe
	  /* This will create ibase.h and other needed include files */
	- cd ..
	  /* do a complete build. If you want an incremental build,
	     do not provide the '-B' option below */
	- build_lib -B -DDEV
	  /* build_lib [-B] [-DDEV]
	     The option '-B' could be given to build everything.
	     If you do not provide '-DDEV', it will build a production
	     version of the runtime kit */

-------------------------------------------------------------------------
*** Build notes ***

- The script 'setup_dirs.ksh' builds some databases that are required 
  by the build scripts and GPRE (pre-processing utility). You may 
  find backup (transportable format) of these databases in the 
  CVS source tree sub-directory builds/original/dbs

- To build an individual component (i.e. the server), change directories to that component and 
type:  make -fmakefile.lib [-DDEV] <rulename>.  Please note that the NT build process does 
not have dependencies so you may need to build more than one component.  For example, if 
you were to change interface.c in remote, to build the client you would need to do the 
following:
    cd ..\remote
    make -fmakefile.lib -DCLIENT remote.rsp
    cd ..\jrd
    make -fmakefile.lib -DCLIENT gds32.dll

  -if you want a debug kit built:
    cd ..\remote
    make -fmakefile.lib -DCLIENT -DDEV remote.rsp
    cd ..\jrd
    make -fmakefile.lib -DCLIENT -DDEV gds32.dll

- If you build an individual component, the binaries for that component will not be copied to 
..\interbase or to ..\ib_debug.  Because of this, it is easiest to debug out of the ms_obj\bind or 
ms_obj\clientd directories (depending on whether the binary is part of the server or client). 

- If for some reason you need to rebuild all files, you can use the -B flag with either make or 
build_lib 

- Build_lib.bat will copy iberror.h from jrd to interbase\include but will not run codes for you.  If 
iberror.h does not exist, then build_lib will fail stating that codes has not been run. 
------------------------------------------------------------------------
