Hi,
I hope you don't mind my reply to the list, but perhaps there are others who'd like a little insight into the Makefiles (or correct my mistakes)...
The Chief wrote:
To make sure that I was not doing anything wrong, I downloaded the latest GPC snapshot again, and extracted the files. I am a bit confused by what I see in the directory tree:
Directory of C:\cygnus\p 03/08/99 08:10 23,724 Makefile.in 1 File(s) 23,724 bytes
Directory of C:\cygnus\p\rts 20/06/99 20:11 3,674 Makefile.in 1 File(s) 3,674 bytes
Directory of C:\cygnus\p 03/08/99 08:18 4,139 config-lang.in 1 File(s) 4,139 bytes
Directory of C:\cygnus\p\rts 05/08/99 18:05 3,107 configure.in 1 File(s) 3,107 bytes
This shows that there are 2 different copies of 'Makefile.in' in the GPC source tree. Which is the right one?
Both of them. Actually, things are even more complicated. The main Makefile is created from Makefile.in and p/Make-lang.in (and possibly Make-lang.in's of other languages when installed). p/Makefile is created from p/Makefile.in. When you call make, you use Makefile. This does some work and at some time calls make with p/Makefile, calls p/rts/configure which creates p/rts/Makefile from p/rts/Makefile.in, and then calls make with p/rts/Makefile. Complicated, huh?
configure.in, p/config-lang.in and p/rts/configure.in are used to create configure and p/rts/configure by the maintainers (with a utility called autoconf), so you don't normally execute them, but only configure, whereas p/rts/configure is called by Makefile (see above).
When I run 'configure' from the 'rts' directory, everything works okay [...]
That might be the problem, very probably indeed. You're not supposed to run configure in the p/rts directory because the Makefile does this and passes some appropriate parameters.
In fact, after some recent changes of mine, it is now possible to run configure in p/rts manually -- but only if a current GPC is already installed, which is exactly not the case when building a new version of GPC...
If I copy the other 'Makefile.in' into the rts directory and run 'configure' from there, a different makefile is generated, which contains references to 'xgpc'. However, this makefile seems buggy. First, it points to '../configure' - which doesn't exist. Second, if I copy 'configure' to where it expects it, then any attempt to run 'make' results in a message that I should invoke it from top level directory.
You should not have to move files around. As described above, the Makefiles and configure scripts in the various directories are quite different ones and only work in their respective directories.
To compile GPC, copy or move `gpc/p' to become a subdirectory `p' of the GCC source directory, `cd' to the GCC source directory, and type
./configure make CFLAGS="-g -O3" LANGUAGES=pascal make CFLAGS="-g -O3" LANGUAGES=pascal install
Well, this does not work, because 'configure' does not exist in the GCC source directory. AFAICS it only exists in the 'p/rts' directory,
No, it should be in the GCC source directory. If it doesn't, this explains why you ran the "wrong" configure, and probably explains the other problems, but why doesn't it exist?
Which GCC sources did you get, the official gcc-2.8.1.tar.gz (or another version) from a GNU site, or from somewhere else? gcc-2.8.1.tar.gz contains one directory (gcc-2.8.1) which is the GCC source directory, and in this directory, there is a configure script. You can rename this directory to whatever you want, but the `p' directory must be a subdirectory of it.
So to sum up:
- in which exact directory do I have to run 'configure'?
In the GCC source directory, which is above the p directory. There must be a configure script there, otherwise something's wrong. You might want to try with the official GNU GCC sources...
- why are there 2 different copies of 'makefile.in' ?
- which is the correct one?
See above. All of them, for different purposes.
- in which exact directory do I have to run 'make' ?
In the GCC source directory, i.e. the same directory where you ran configure.
- Is the generated copy of 'Makefile' correct, or do I have to make
manual changes?
You should not have to make any manual changes.
However, you might need some additional makeflags (i.e. parameters on the make command line), e.g. (most likely) `exeext=.exe'.
Also, you'll need a fairly complete set of GNU file, text and other utilities for the compilation and installation to succeed, including `ln' (in whatever way this might be realised, since MS-Windows does not support symbolic or hard links, AFAIK -- but if `ln' just copies, this would be sufficient here, except for increased disk space usage).
Frank