# [lazarus] Compiler working)

Michael Van Canneyt michael.vancanneyt at wisa.be
Tue Apr 18 08:18:43 EDT 2000



On Mon, 17 Apr 2000, Curtis White wrote:

> Actually, this is a good idea.  We could have a function in the LCL that returns
> the path to the configuration directory ( getConfigPath() ). In Win32, it could
> return the path where Lazarus is installed and in Linux it could return the
> ~/.lazarus path. Then anything within Lazarus that needs the path to the
> configuration files could just ask this function and depending on where you are
> compiling the LCL it would return the proper path.
>
> Would this work?  The only problem I could see with this is how would that function
> know where the Win32 installer installed Lazarus?

2 ways:

1) Paramstr(0) returns the complete path of the lazarus binary (ALSO on linux)
doing a extractfilepath(Paramstr(0)) then gives what you need.

2) The installer can install a registry key
\HKEY_LOCAL_MACHINE\Software\Lazarus\1.0\bin
appdirectory=\path\to\lazarus installation.
You can retrieve this value. This is standard functionality for install programs.

So I think this is easy :-)

Michael.

>   On Linux it is easy because you
> just look for ~ and depending on what user is logged on you get the path to their
> home directory. I think Win32 is going to be a little more difficult.
>
>
> Curtis
>
> codepunk wrote:
>
> > Is there some way to just translate the file paths internal to the compiler
> > options component. It may make more sense to do that instead of creating a whole
> > new component. This should actually maybe part of the LCL to avoid the platform
> > specific code in the IDE.
> >
> > Cliff
> >
> > On Mon, 17 Apr 2000, Curtis White wrote:
> > > Probably the reason is your path is different. Right now, the path in the
> > > compiler options is hardcoded to /opt/fpc/lazarus/compileroptions.xml.  If
> > > that path doesn't exist for you, then it would probably crash. I am going to
> > > fix that, maybe tonight. I am going to make it check for
> > > ~/.lazarus/compileroptions.xml and if it doesn't exist to create it using
> > > default values. If we want, I can make it also check for
> > > /etc/compileroptions.xml before it creates it in ~ and use that one for
> > > defaults if it exists. What do you all think?
> > >
> > > Also, we don't currently have a win32 and linux directories for Lazarus (only
> > > for the LCL). I need to create the compileroptions.pp differently for Windoze
> > > than for Linux (paths are handled differently). So should I create win32 and
> > > linux directories and have a version of the compiler options file for each, or
> > > should I put in IFDEF statements into the code?    If we create the
> > > directories, then we will have to add that into the Makefiles, which I don't
> > > know how to do.  So how should I handle this?
> > >
> > >
> > > Curtis
> > >
> > > Marc Weustink wrote:
> > >
> > > > At 14:53 17-04-2000 -0500, Shane Miller wrote:
> > > > >I created the initial code for the compiler.  To try it, do the following:
> > > > >
> > > > >Run lazarus.
> > > > >Go into Compiler Options and set your compiler path.
> > > >
> > > > :-( Lazarus crashes when setting this
> > > >
> > > > Marc
> > > >
> > >
> > > _________________________________________________________________
> > >      To unsubscribe: mail lazarus-request at miraclec.com with
> > >                 "unsubscribe" as the Subject
> > >     archives at http://www.miraclec.com/list_archives/lazarus
> >
> > _________________________________________________________________
> >      To unsubscribe: mail lazarus-request at miraclec.com with
> >                 "unsubscribe" as the Subject
> >     archives at http://www.miraclec.com/list_archives/lazarus
>
> --
> ----------------------------------
> Curtis White
> cwhite at aracnet.com
> http://www.aracnet.com/~cwhite/
> ----------------------------------
>
>
>
> _________________________________________________________________
>      To unsubscribe: mail lazarus-request at miraclec.com with
>                 "unsubscribe" as the Subject
>     archives at http://www.miraclec.com/list_archives/lazarus
>