GNU Pascal Homepage - gpc - gpc-announce - gpc-de - gpc-doc
This page in English

Mail #14595

Zurück zur Archiv-Hauptseite

Vorige Mail   Nächste Mail   Unformatiert/Volle Header
Übersicht  10 Tage   Betreff   Datum   Thread   Autor  

Von: Maurice Lombardi
Betreff: Hi everyone - got a question about GPC
Datum: 16.2.2010, 18:45:51

Rugxulo a écrit :
> 
>>> 2). DJGPP has a habit of making both "blah" and "blah.exe" when you
>>> type "gpc blah.pas -o blah". This also affects your GP program. It's
>>> really only useful with *nix makefiles (so the target and file will be
>>> recognized), but it's pretty useless and annoying otherwise.
>> AFAIR, "blah" is the COFF executable which can be called from other
>> DJGPP programs,
> 
> Honestly, nobody uses plain COFF files anymore. That's a relic from
> when a separate GO32.EXE was needed (DJGPP v1). But DJGPP can "call"
> (run) either plain COFF or .EXEs anyways.
> 
>> and "blah.exe" is prefixed with a DOS loader (which
>> is done by the "stubify" program), so it can be called from plain
>> DOS programs as well. So depending on your needs, either or both may
>> be useful.
>>
>> But it's been long since I've used DJGPP, so in case this was
>> inaccurate or incomplete, Maurice will correct me, I hope.
> 
> You're right in that it used to be that way. But somewhere along the
> line it changed. I'm not sure if it's correct, but I *think* BinUtils
> (e.g. LD) handles it differently now. At least, using DJGPP 2.04, GCC
> 4.4.2, LD 2.19.1, 'gcc -s -O blah.c -o blah" (simple "Hello, World!"
> example) produces "blah" and "blah.exe" that are 100% identical (with
> stub, i.e. both in .EXE format).

Correct, this was not the case for gcc 3.4.4 I use as backend for gpc.

In fact for that reason, in my personal works I always use the option -o 
blah.exe.
This causes no extra typing because I work in an editor able to launch a 
compiler with a single click through a script like

#! /bin/sh
echo $MSYSTEM
gp $(basename "$1" | tr [A-Z] [a-z]) \
	-o $(basename "$1" | sed -e 's/\(.*\)\.[^.]*$/\1\.exe/') \
	$2 -march=prescott \
	--unit-path=. --unit-path=c:/lombardi/$MSYSTEM/gpc/pascal_u \
         --unit-path=c:/$MSYSTEM/units \
         --unit-destination-path=c:/lombardi/$MSYSTEM/o \
	`head -n 1 "$1" | sed -e '/^[^"]*$/d;s/^[^"]*"//;s/"[^"]*$//'` \
	2>&1 | sed ':1;s,/[^/.][^/]*/\.\./,/,;t 1'

MSYSTEM is either DJGPP or MINGW (set when launching the editor)
$2 is --autobuild or nothing
the next to last line recovers extra compilation parameters, program 
dependent, which are putted in the first line between two " " as a 
Pascal comment between {}
the last line (borrowed from mingw HOWTO) takes care of the annoying 
../../ which are interspersed in pathes especially when you use the -v 
option
All this depends on your habits in files organisation, default 
parameters if any etc

As editor I have used in DOS/Windows TextPad, FPE, Context (which gave 
me the idea of the parameters in the first line, in which it is built 
in) and in Linux gedit, SCite (others more common editors are too C and 
makefile oriented: there is really no reason now to use a makefile in 
pascal).
These editors (at least those I use now) generate an error buffer and 
are able to open directly the proper file and put the carret at proper 
place when clicking on an error message.
Very probably there are many others (I never tried OS X for example), 
and many are free.

Maurice

Vorige Mail   Nächste Mail   Unformatiert/Volle Header
Übersicht  10 Tage   Betreff   Datum   Thread   Autor  


Antworten auf diese Mail

Autor Betreff Datum
Rugxulo Hi everyone - got a question about GPC 16.2.2010, 14:09:32
Maurice Lombardi Hi everyone - got a question about GPC 17.2.2010, 12:08:48
Frank Heckenbach Hi everyone - got a question about GPC 18.2.2010, 07:48:00
Rugxulo Hi everyone - got a question about GPC 18.2.2010, 14:24:35

Antwort auf

Autor Betreff Datum
Martin Liddle Hi everyone - got a question about GPC 13.2.2010, 13:32:54
Frank Heckenbach Hi everyone - got a question about GPC 14.2.2010, 02:33:37
Rugxulo Hi everyone - got a question about GPC 14.2.2010, 18:23:22
Frank Heckenbach Hi everyone - got a question about GPC 15.2.2010, 23:11:19
Rugxulo Hi everyone - got a question about GPC 15.2.2010, 23:53:09

Zurück zur Archiv-Hauptseite


Hinweis: Diese Seite enthält Informationen, die nicht vom Betreiber dieser Website, sondern von den Autoren der archivierten Mails stammen. Der Betreiber dieser Website ist nicht für den Inhalt dieser Informationen verantwortlich. Die weitere Verwendung dieser Informationen bedarf des Einverständnisses des jeweiligen Autors.

Sofern WWW-Adressen (URLs) in den archivierten Mails als Hyperlinks hervorgehoben werden, so geschieht dies ausschließlich zur Annehmlichkeit für den Leser. Der Inhalt der auf diese Weise angelinkten Webseiten spiegelt nicht notwendigerweise die Meinung des Betreibers dieser Webseite oder der Autoren der archivierten Mails wider. Der Betreiber dieser Webseite ist nicht für den Inhalt solcher Webseiten verantwortlich. Diese Seiten sind ausdrücklich nicht als Teil des Inhalts dieser Seite zu betrachten, sondern lediglich als Referenzen.


Diese Seite wurde erzeugt von Crystal 0.999 (Linux 2.4.27/i686).