Configuration files (was: Standard compatibility)_(re)

Sat, 5 Apr 1997 18:51:28 +0200



Peter Gerwinski wrote:

> However I have planned to make it possible to put all compiler options
> (including `--automake' :) into the source, so you will be able to
> compile any Pascal program just with "gpc progname.pas".

That would be great!

Putting "--automake" into the source seemed strange to me at first sight,
but when I think about it, it can be useful for distributing programs.

Does this also include the "-o ..." option? In this case, this "problem"
would also be solved by putting "{$o destname}" into the main program.
BTW: Are compiler options case sensitive? Otherwise there would be a possible
confusion with BP's "{$O filename}" for overlays.

I also suggest a compiler switch that will always choose the base filename as
the destination filename, unless an explicit "-o ..." option is given.
Then I could put this switch into a global configuration file/specs/whatever
and wouldn't usually have to worry about "-o ..." options.

>   * I will try to make it possible to pass these command-line options
>     as compiler directives, e.g. (*$field-widths=12,24,6*).

In such a way that they can be changed at any point in the source, like in
this (extreme and not very sensible) example:
 write({$field-widths=0,0,0}a,{$field-widths}b)

Perhaps also "--no-field-widths", equivalent to "--field-widths=0,0,0"?

The "-O" (optimization) switches could also be useful in the source, like:

[some non-time-critical code]

{$O2}

[very time-critical code]

{$O0}

[some non-time-critical code]

This example also shows that it can be desirable to "push" and "pop" options.
It would be better to write e.g. (tentative syntax):

[some non-time-critical code]

{$BEGIN}{$O2}

[very time-critical code]

{$END}

[some non-time-critical code]

Then, after the "{$END}", the options would be like they were before the
"{$BEGIN}", and if "-O2" was given from the command line, it would still
be on in the last part of the code.

In fact, this is a missing feature of BP, and is often solved by workarounds
like:

{$IFOPT R+}{$DEFINE R}{$ENDIF}{$R-}
[...]
{$IFDEF R}{$R+}{$ENDIF}

This works for a switch with only 2 possible values ({$R+} and {$R-}), but for
siwtches like {$field-width=x,y,z}, it's not possible to do it like that, and
it's not very nice anyway...
So, pushing and popping options would really be a plus.

> In fact DJGPP supports symbolic links on DOS.

Really? I didn't find an "ln" command on my system. I installed just the
necessary DJGPP stuff, do I need some more packages for symlinks? And do
symlinks also work for executables, or only for files accessed from within
DJGPP programs? Anyway, I don't think this would be a good solution for
DOS systems, but as many of you have shown, there are enough ways to supply
default switches on any system, with or without an IDE...
-- 
Frank Heckenbach, Erlangen, Germany
heckenb@mi.uni-erlangen.de
Turbo Pascal:   http://www.mi.uni-erlangen.de/~heckenb/programs.htm
Internet links: http://www.mi.uni-erlangen.de/~heckenb/links.htm


Frank Heckenbach (heckenb@mi.uni-erlangen.de)

HTML conversion by Lluís de Yzaguirre i Maura
Institut de Lingüística Aplicada - Universitat "Pompeu Fabra"
e-mail: de_yza@upf.es