[lazarus] OS Specific Issues

Curtis White cwhite at aracnet.com
Wed Apr 19 01:41:40 EDT 2000

Well, after looking at it again, putting these OS specific functions into the
LCL doesn't really make sense after all (you were right Marc).  The LCL isn't
really OS specific. Instead, it is widget specific. For example, GTK runs on
Windows and Linux. We don't really have anything in there, that I can find, that
says to do something a certain way on Linux as opposed to Windows. Instead,
everything is based on a widget set, Windows being just another widget set.

So now I am back to trying to figure out how to do this. So maybe it does make
sense to setup Lazarus similar to the RTL or FCL by creating a linux directory
and a win32 directory. Then to create a .pp file that contains function
definitions and their implementations that are specific to the OS. Then in the
makefile, we can tell it to compile in the linux file on Linux and the win32
file on Windows. I don't really know of a better way to do this unless we create
a file and have IFDEFs in it. If we do it that way, then we should have just a
single file that contains ALL the OS specific code. So which way do you all
think we should do it?

I prefer to be consistent with FPC and to have a linux and win32 directory with
the same file in each, but implemented differently. I have created this
structure on my PC and if everyone agrees, I will check it into CVS this way.
But since I have to create a linux and win32 directory, it is going to break CVS
for a little while until one of the FPC guys can fix the permissions. Do you all
agree with this method and want me to check it in?


Curtis White wrote:

> But the bigger problem is that it is different on Linux. So we must somehow
> provide a way for Lazarus to find the path to its config files on Linux and
> also on Win32.  And we need to do this without having two versions of Lazarus
> and also without using IFDEFs.  So the only other way I can think of is to
> provide a function in the LCL, where we compile it different for each OS,
> that will tell us how to find the config path.
> We don't need to hard code the paths. We just need to define the rules
> differently. On Linux, it needs to look in ~/ first, then /etc, then use the
> defaults. On Windows it needs to look in the directory where the exe is
> installed, then in windows\system, then use the defaults.  Notice, that the
> rules are different and will most likely be different still again if we ever
> create Lazarus for another platform like OS2, Mac, etc.  So to me it makes
> the best sense to put this into the LCL where we already distinguish the
> difference between OS's.
> I am open to any other suggestions that anyone might have.  For now, I will
> go ahead and code a function into the LCL that will define the rules for the
> config path.  Maybe we need some sort of TLazarus class in the LCL that is
> designed to hold code created specifically for Lazarus and not to be used by
> other programs????

More information about the Lazarus mailing list