Mail Archives: djgpp/2001/03/21/13:39:56
Mr. Veli Suorsa wrote:
> I first download GPC from mirror sites:
> ftp://ftp.funet.fi/pub/mirrors/simtel.net/pub/simtelnet/gnu/djgpp/v2gnu/gpc20bb.zip
slightly outdated, but should work
> I tried (with Big African Chief help) sites:
> ftp://agnes.dida.physik.uni-essen.de/gnu-pascal/djgpp/gpc20ab.zip
This is completely outdated. works only with gcc-2.8.1 (which is included in the same directory). Better forget and upgrade.
> It does not work with Rhide, neither.
Normal if you have gcc2952
> And I got a new download- siteaddress from CloseBSD, which works:
> ftp://agnes.dida.physik.uni-essen.de/home/maurice/gpc2952b.zip
OK. I try to always give under this same link the lastest gpc snapshot I have compiled, and which give zero error when
running the whole test suite.
>> What exactly does not work and what are error messages ?
>
>
> I saw from Rhide screen command:
> gpc -o pay3_4.exe --automake="-g" -g pay3_4.pas -lgpc -lm
There is no need for options to automake now, and you get a warning.
> before editing djgpp.env file.
> and
> error message was like:
> ....
> undefined reference to '-p-inoutres'
> ....
> collect2: ld returned 1 exit status
>
>
> Adviced GPC version works with Rhide Menu in two parts: -compiler and -make,
> not yet -Build all.
> Can you tell me why -Build all does not works?
The build option in rhide is intended for C programming. Rhide looks to all the files in the project and force their
recompilation (presumably by deleting the corresponding .o (and .exe) files, I am not sure).
The logic in pascal is different: there is no real need for a project because the dependencies are contained in the uses
clauses inside of the pascal programs and units. (C cannot do that way because dependencies are usually dealt with with
header files (.h) and that there is no uniquely defined link between a header file and the .c files which contain the
actual C code). Practically nobody includes then in a pascal project all files needed (especially the standard files
contained in the "units" directory, the user frequently does not even know about, especially about their dependencies).
This is quite convenient in practice, but rhide cannot delete all .o files that would be necessary because it does not
know about the content of the pascal files, and anyway it noes not delete the .gpi and .gpm files it does not even know
about.
To force a build in pascal you need to replace --automake by --autobuild as compilation option.
But this is nowhere provided for in rhide (and in particular is not done when you hit compile/build) because of the
different logics: looking into the makefiles generated by rhide you have provision for RHIDE_COMPILE_LINK_AUTOMAKE but
not for RHIDE_COMPILE_LINK_AUTOBUILD
>>From Dos command line Gpc compiler:
> gpc -g -c pay3_4.p -o pay3_4.o
>
> works, ...
>
> and make:
> gcc -o pay3_4.exe pay3_4.o -lgpc -lm
>
> works, too.
>
>
> I had to do some adds/ changes to djgpp.env file like:
>
> [gpc]
> COMPILER_PATH=%/>;COMPILER_PATH%%DJDIR%/bin
OK This is necessary.
> [rhide]
> RHIDE_TYPED_LIBS_DJGPP.p=gpc m
> RHIDE_TYPED_LIBS_DJGPP.pas=gpc m
libgpc and libm are linked automatically now, so you can type simply
RHIDE_TYPED_LIBS_DJGPP.p=
RHIDE_TYPED_LIBS_DJGPP.pas=
but this causes no harm
However in looking to my rhide makefiles (1.4.7.8) I see instead
RHIDE_TYPED_LIBS_GPC=gpc m
with I superseded in djgpp.env by
RHIDE_TYPED_LIBS_GPC=
You have probably an older version of rhide. Better upgrade.
> PASCAL_TYPE=GPC
OK
> RHIDE_LD_PASCAL=gcc
? for me it is gpc
> RHIDE_COMPILE_GPC=$(RHIDE_GPC) $(RHIDE_GPC_FLAGS) $(LOCAL_OPT) -c $(SOURCE_NAME)
> -o $(OUTFILE)
> RHIDE_COMPILE_LINK_GPC=$(RHIDE_LD_PASCAL) $(RHIDE_LIBDIRS) $(C_EXTRA_FLAGS)
> -o $(OUTFILE) $(OBJFILES) $(LIBRARIES) $(RHIDE_LDFLAGS) $(LDFLAGS) $(RHIDE_LIBS)
>
> RHIDE_COMPILE_LINK_PASCAL_AUTOMAKE=$(RHIDE_COMPILE_LINK_$(PASCAL_TYPE))
This is unnecessary since it is identical to the defaults contained in rhide. What is necessary is:
RHIDE_COMPILE_LINK_GPC_AUTOMAKE=$(RHIDE_LD_PASCAL) $(RHIDE_LIBDIRS) -o $(OUTFILE) --autobuild $(RHIDE_GPC_FLAGS)
$(SOURCE_NAME) $(LIBRARIES) $(LDFLAGS) $(RHIDE_LDFLAGS) $(RHIDE_LIBS)
i.e. suppress options to automake to avoid those stupid warning messages, and probably replace --automake altogether by
--autobuild.
I am not sure that the latest replacement is still necessary. It was sometimes ago but I have not checked it recently.
It increases compilation time, but it is more secure.
An other convenient way is to use a compilation option --unit-destination-path= (better included automatically in the
default rhide project if you work mainly in pascal) to put all .o .gpi .gpm files into a given directory, and to delete
manually all the content of this directory when you want a rebuild (easy only if you work in a windows dos box not to
need to exit from rhide each time you need to do that, or you can have a .bat file in your path to do that and do it by
exiting temporarilly from rhide by hitting File/Dos shell).
Anyhow be carefull that you have to delete all these files each time you upgrade to a new version of gpc.
Hope this helps,
Maurice
--
Maurice Lombardi
Laboratoire de Spectrometrie Physique,
Universite Joseph Fourier de Grenoble, BP87
38402 Saint Martin d'Heres Cedex FRANCE
Tel: 33 (0)4 76 51 47 51
Fax: 33 (0)4 76 51 45 44
mailto:Maurice DOT Lombardi AT ujf-grenoble DOT fr
- Raw text -