Rugxulo wrote:
On Tue, Feb 16, 2010 at 11:45 AM, Maurice Lombardi Maurice.Lombardi@ujf-grenoble.fr wrote:
In fact for that reason, in my personal works I always use the option -o blah.exe.
Well, GPC actually appends TARGET_EXECUTABLE_SUFFIX which can be set by the backend target specification. I assume it's not set in the DJGPP backend, but I don't know why. Historically it was because there was reason for the COFF file; if that's no more the case, it could have been set by default, AFAICS. (That would be a matter for the GCC developers, in particular for the DJGPP backend.)
If you want to hack it yourself, you can probably just insert something like
#ifdef __DJGPP__ #define TARGET_EXECUTABLE_SUFFIX ".exe" #endif
near the start of p/module.c and rebuild GPC (untested).
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'
Whew! Perl, where are you when we need you? :-) Anyways, you could probably also use sed instead of tr and head; that would be cleaner, IMHO. But I'm not very *nix savvy, so who cares. ;-)
Unix says, the right tool for the job.
Why use perl when awk will do, or awk when sed will do, or sed when tr or grep will do (at least that's my principle) ...
For the record, I was unable to figure out compilation from within PENG. Besides, it (DOS version) whines upon startup in NT (Vista), something about printer or something silly like that.
Since PENG is slightly OT here, I'll keep my answer short. For more discussion, please PM (f.heckenbach@fh-soft.de) or the PENG mailing list (see http://fjf.gnu.de/peng/ under "Contact").
PENG should support GPC compilation, ideally simply by pressing F9. Options can be set under "Options/Pascal". "Options/Pascal/Show sample GPC command line" will show what it will actually use. If you don't get along with this, you can also enter a command under "Options/Try a tool" (using the current file name as "$EDNAME", appyling file name functions etc., see the online help), and if it works for you, you can permanently define it as a tool under "Options/Tools".
About the printer, do you get: "file 'prn' cannot be opened for writing"? (And yes, I agree that accessing the printer via a device file is silly, but that's the way it is/was under Dos.) After pressing Esc, will it work normally? (If that's all, I could probabably get rid of this somehow.)
Frank