On Fri, 4 Apr 1997, Frank Heckenbach wrote:
- A way to read in configuration files (like "gpc @gpc.cfg") seems good (in addition to environment variables and command line options). Even if gpc doesn't read in a config file by default, it should be no problem to set an alias accordingly (BTW, even modern DOSes support something like alias in the form of DosKey...)
Let me remind you that:
1) A config file already exists and it is called `specs' (`specs.gpc' if you're using the djgpp version). It is shared among all members of the GNU compiler family. Introducing a second, gpc specific config file doesn't make sence IMHO.
2) GPC doesn't have to be modified to implement the @file trick. This is a DOS "feature" to overcome DOS commandline-length limitations.
If you want a certain behaviour than:
------------- begin bpc.cfg --------------
--automake --borland-pascal --my-wild-language-switch
--------------- end bpc.cfg --------------
and:
------------- begin bpc.bat --------------
@echo off gpc @c:\djgpp\bin\bpc.cfg %1 %2 %3 %4 %5 %6 %7 %8 %9
--------------- end bpc.bat --------------
This will do just what you want. Usually you would put the long-name options which select the dialect in the CFG file (you want these always on/off) and set optimization (-On) and debugging (-gn) from the command line.
3) If you are a delphi/tp user and want point-and-click userfriendlyness, I suggest you install RHIDE. Will look very familiar. Can even write one of those dreaded makefiles for you ;-)
- Putting those flags in a makefile is also an option, but only if one is to use makefiles at all. Personally, I don't like makefiles, and I think Pascal programs don't need makefiles, since all the dependencies between modules are there in the code (unlike C). Therefore, I'd like to be able to compile any Pascal program with simply "gpc --automake progname.pas". Any compiler options should be in the source (at least there should be a way to do so).
Answered above (I hope)
BTW (not quite to this topic): Is there any reason why the default output file is called "a.out" (or "a.exe" with DOS) - other than historical reasons? Wouldn't it make more sense to default to the base filename of the main program, in order to save programmers from typing "gpc -o x x.pas"?
Besides hisotorical reasons, it is ofen used in automated testsuites (in a unix environment) where the compiler is run on a large set of source files.
- Naming the program gpc, spc, epc and bpc seems like a sensible way for Un*x, but on systems that don't support either hard or symbolic links (aka DOS), it would mean 4 separate binaries - probably not a good solution there (although those DOS users who want to do only Borland style could rename gpc.exe to bpc.exe). So this could be one, but not the only, way to choose the defaults.
I'm currently experimenting with a seperate compiler pre-driver (like g++ and f77) which can set the language switches when invoked as `bpc' or `gpc' etc. It's about 15K which is small compared to the 1.5M of gpc1, even if you install it 4 times because your OS lacks symlinks.
just my HFL 0.02,
JanJaap --- Thus spake the master programmer: "After three days without programming, life becomes meaningless." [The Tao Of Programming]