According to Jan-Jaap van der Heijden:
[...]
- 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.
I agree in principle, but I just had a look at that `specs' file. It seems to be written in some alien dialect for me, and the info documentation does not say anything about its format.
If there is an easy way to put GPC options into this `specs' file we should document is. This would cover some applications of a `gpc.cfg' file, but not all: `specs' is a global configuration file while `gpc.cfg' would be local.
- GPC doesn't have to be modified to implement the @file trick. This is
a DOS "feature" to overcome DOS commandline-length limitations.
[...]
Yes, but this does not work on non-DOS platforms. I didn't find it in the GPC source, so it seems that we cannot enable it for other platforms (assuming for the moment that we want to do that).
- 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 ;-)
I agree. The RHIDE can provide menus for all command-line options.
- 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)
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".
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.
EMX defaults to compile `x.pas' to `x.exe'. RHIDE does "gpc -o x.exe x.pas" automatically.
On my Linux box, I use a shell script
gpc --some-options --automake="--some-more-options" -o $1 $1.pas -lmylibs
which does both: specify the name of the executable and pass all options to the compiler.
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.
In fact DJGPP supports symbolic links on DOS. But anyway, Jan-Jaap's solution will - hopefully - eliminate a lot of trouble.
Peter
Dipl.-Phys. Peter Gerwinski, Essen, Germany, free physicist and programmer peter.gerwinski@uni-essen.de - http://home.pages.de/~peter.gerwinski/ [970201] maintainer GNU Pascal [970401] - http://home.pages.de/~gnu-pascal/ [970125]
On Fri, 4 Apr 1997, Peter Gerwinski wrote:
According to Jan-Jaap van der Heijden:
[...]
- GPC doesn't have to be modified to implement the @file trick. This is
a DOS "feature" to overcome DOS commandline-length limitations.
[...]
Yes, but this does not work on non-DOS platforms.
Hah! , how 'bout this:
------------- ~/.gpcrc -------------------
--borland-pascal --automake
----------------- end ---------------------
and:
------------- /usr/bin/bpc ----------------
#! /bin/sh
if [ -f ~/.gpcrc ] ; then CFG=`cat ~/.gpcrc` ; fi gpc $CFG $*
------------------ end ---------------------
The rest is up to your imagination.
Greetings, JanJaap
--- Thus spake the master programmer: "After three days without programming, life becomes meaningless." [The Tao Of Programming]