[lazarus] Reformatted Win32 getting started howto

Michael Wood wood at kingsley.co.za
Wed Jul 28 09:10:17 EDT 1999


Hi

I've just read through the Win32 howto and found it a little annoying that I
had to keep scrolling left and right to read it.  This is because everything
is in <pre> and </pre> tags and the lines are rather long.

I decided to reformat it slightly.  The content is identical except that I
changed "TK" to "GTK" in the Thanks section and I changed "take affect" to
"take effect." later in the document.  The main thing I did was change most
of the <pre> tags into <p> tags.

I would have sent this directly to Jeffrey Alan Wormsley (the author) but I
couldn't find his e-mail address anywhere.

Anyway, here it is (I assume he's reading this list) in case he thinks it's
useful.

--
Michael Wood        | Tel: +27 21 762 0276 | http://www.kingsley.co.za/
wood at kingsley.co.za | Fax: +27 21 761 9930 | Kingsley Technologies


Title: Win32 How To






Lazarus-win32-HowTo-0.2

Thanks to:
	Cliff Baeseman - For tremndous help getting me
	started
	Sergio A. Kessler - For the linux version of this
	document, which was my guide
	Mike Z. - For providing the links to get the GTK
	DLL's and all of the Lazarus
	development team who endured my seemingly endless
	questions!

Installing Lazarus on a Windows 95/98
System

This is a decription of the steps that I took to get Lazarus
set up on my system.  It may seem like a lot more downloads than
are absolutely necessary, and it probably is, but it works, and
that is the most important thing.

First, you need to download a lot of files.  The files you
will need and their locations are listed below.  I suggest
creating a directory to store all of these for future reference.
Mine is \Install\Lazarus, with each package getting their own
subdirectory under that.  These are the latest version as of
this writing.  You may want to check the parent page/directory
to see if newer versions are available.


FPC       - ftp://tflily.fys.kuleuven.ac.be/pub/fpc/dist/Win32 / win3209912full.zip
GTK DLL's - http://user.sgic.fi/~tml/gimp/win32 / gtk+-19990621.zip
            http://user.sgic.fi/~tml/gimp/win32 / glib-19990621.zip
CVS       - http://download.cyclic.com/pub/cvs-1.10/windows / cvs-1.10-win.zip


1. Installing the sofware

Extract the FPC installation file to a temporary directory
and run Install.  Unless you are terminally short on hard drive
space, I suggest you install everything.  Use the suggested
path, but feel free to change the drive letter.  At the end of
the install, a box will appear telling you to add a directory to
your path.  Write this down somewhere, we'll come to this
later.

Next, extract the GTK DLL files.  Where you extract these
files is up to you, but it will need to be on your path.  If you
want, you can extract them to your Windows directory, and it
will be there automatically.  If you want to keep it seperate
for ease of uninstall or update, then add this path to the note
you made for FPC.

Finally, extract the CVS zip to the location you want to run
it from.  Add this path to your list.

2. Updating your AUTOEXEC.BAT file.

You need to add all of the paths noted above to your path
statement.  If you installed anything into a path with long file
names, you need to use the short name to add it to the path.
Just open a dos box in the directory above and type DIR /AD /P
to get the short directory name.  Here is an example of my path
line...

path c:\windows\command;c:\batch;D:\PROGRA~1\CVS;E:\pp\bin\win32;e:\pp\gtkdll

Next, you need to set a few environment variables.  These
will depend on where you installed things, but aren't hard to
figure out.

First, the CVS requires three entries.  Here are my settings.
The CVSROOT ***must*** be set exactly as shown.  The other two
depend on where you installed CVS.


	SET CVSROOT=:pserver:cvs at tflily.fys.kuleuven.ac.be:/usr/local/CVS
	SET HOMEDRIVE=D:
	SET HOMEPATH=\PROGRA~1\CVS


Last, we need to set the FPCDIR directory.  If you followed
the anove instructions and let FC install to the \pp directory,
all you will need to change here is the drive letter.


	SET FPCDIR=e:/pp/source


Note that I used / instead of \.  I had problems using the
normal DOS style seperator, but they went away when I changed to
the /, so since it doesn't matter to FPC, I left them that way.
If you use the \, and later have problems building files because
they can't be found, change to the / and it should work.

Now, you will need to reboot for these changes to take
effect.

3. Downloading the Lazarus code from CVS

In a DOS box, switch to the Free Pascal source directory. For
me this was e:\pp\source.  Now log on to CVS.  You should only
need to do this once.


	cvs login


You should get a connect message inicating success.  If not,
double check that your PATH and all three environment variables
are set correctly.  You can test with the following:


	echo %PATH% <ENTER>
	echo %HOMEDRIVE% <ENTER>
	echo %HOMEPATH% <ENTER>
	echo %CVSROOT% <ENTER>
	echo %FPCDIR% <ENTER>


Now check out the code modules.  See the
Lazarus-developer-HowTo for the complete list of modules
available, but for now these will be all you need.


	cvs -z3 checkout base gtk api fcl docs lazarus


This will take a while.

4. Create a compiled units directory

Starting from your Free Pascal source directory:


	md units <ENTER>
	cd units <ENTER>
	md win32 <ENTER>


5. Create a batch file for rebuilding your compiler.

First, back up your release version of the compiler.  Go to
the \pp\bin\win32 directory and copy ppc386.exe to ppc386r.exe
(r for release).  Don't rename, copy.

Now create the following batch file.  Here's mine.  Change
line 2 to reflect the correct drive for your Free Pascal
installation.


	@echo off
	e:
	del \pp\bin\win32\ppc386.exe
	ren \pp\bin\win32\ppc386r.exe ppc386.exe
	cd \pp\source
	echo y | del units\win32\*.*
	cd compiler
	make clean
	make cycle
	cd ..
	copy rtl\win32\*.ow \pp\source\units\win32 >NUL
	copy rtl\win32\*.ppw \pp\source\units\win32 >NUL
	ren \pp\bin\win32\ppc386.exe ppc386r.exe
	copy compiler\ppc386.exe \pp\bin\win32
	copy /Y base\*.* >NUL


6. Create a batch file for updating your sources.

Each time you do this, you will be on the bleeding edge of
development.


	@echo off
	e:
	cd \pp\source
	cvs -z3 update base gtk api fcl docs lazarus compiler


7. Compile everything

Now is the time to see if all this has paid off.  Here is a
batch file that can be handy for automating this task, or just
do each step manually.


	@echo off
	e:
	cd \pp\source\fcl
	make clean
	make
	cd \pp\source\gtk
	make clean
	make
	cd \pp\source\lazarus
	make clean
	make


8. Periodic maintenance

Every so often you may want to get caught up with the current
code.  To do this, just use the batch file for updating source
you created in step 6, then rebuild your compiler with the batch
file from step 5, and finally use the batch file from step 7 to
put it all together.  You may want to archive your setup before
you do this, as there may be problems with the new code you
download, and you will want a way to get back to where you
were.


	Good luck,
	Jeff


Appendix A - Directory Structure

Here is an example directory structure from my installation.
It may not match yours (GTK DLL location) but it should be
close.


	\pp
	\pp\bin
	\pp\bin\win32
	\pp\doc\..        <--- The \.. means other subdirectories too numerous to mention
	\pp\gtkdll        <--- This depends on where you install the GTK DLL files
	\pp\msg
	\pp\rtl\..
	\pp\source\base
	\pp\source\compiler\..
	\pp\source\demo\..
	\pp\source\docs\..
	\pp\source\fcl\..
	\pp\source\gdbpas\..
	\pp\source\gtk\..
	\pp\source\ide\..
	\pp\source\lazarus
	\pp\source\rtl\..
	\pp\source\units\win32


Revision History

0.1 Initial Release

0.2 Cleaned up directory structure, new REBUILD.BAT, new
Appendix with directory tree

Copyright © 1999, Jeffrey Alan Wormsley






More information about the Lazarus mailing list