On Tue, Jul 08, 2014 at 01:21:07PM +0200, Tomas Hajny wrote:
On Tue, July 8, 2014 12:07, Mark Morgan Lloyd wrote:
Tomas Hajny wrote:

Incidentally, how does one get a list of fpc's options? I don't mean fpc -h since that actually shows ppcXXX's options, but how does one get minimal info on fpc itself such as a reminder of the -V option?

In trunk, fpc -h shows all options supported by either fpc or ppcXXX (technically, ppcXXX still shows the list, but it includes fpc specific options if invoked from fpc). The part handled specifically by fpc should not be of such a high interest normally, but it may be obtained by diffing the output of both.

I agree that it's obscure, but there was discussion of -V a few weeks
ago in the context of starting Lazarus and I needed a reminder
yesterday. Looking at 2.6.4 source, I note also -PP and -PB with the
apparent "health warning" that they aren't qualified by the -V parameter.

I meant specifically that most users should not need to differentiate
between options handled by fpc and options handled by ppcXXX.

Anyway - if you want to find out options specific to the fpc helper
(and/or you don't have a compiled trunk compiler readily available), you
can also use:

grep -e "^F\*" < fpcsrc/compiler/msg/errore.msg  | cut -c3- |
sed "s/^1/-/" | sed "s/^2/ -/" | sed "s/_/   /"

Yes, I should know better than to reply here on this, but I am fascinated by how this one line UNIX command can parse the error message source file and extract the option information.

In general would it be more efficient to combine all the sed commands into one with multiple -e options, saving the extra pipes between commands, or would there be drawbacks?

grep -e "^F\*" < fpcsrc/compiler/msg/errore.msg  | cut -c3- |
sed -e "s/^1/-/" -e "s/^2/ -/" -e "s/_/   /"

Apologies for being off-topic. I am interested in what it is safely compatible to do across various environments in clever compile scripts.

(again, you need the trunk version of errore.msg as available e.g. from
http://svn.freepascal.org/cgi-bin/viewvc.cgi/trunk/compiler/msg/errore.msg?revision=28152&view=co)

That gives the following list:

-P<x>   Target CPU / compiler related options:
-PB   Show default compiler binary
-PP   Show default target cpu
-P<x>   Set target CPU
(arm,i386,m68k,mips,mipsel,powerpc,powerpc64,sparc,x86_64
-V<x>   Append '-<x>' to the used compiler binary name (e.g. for version)
-Xp<x>   First search for the compiler binary in the directory <x>

Tomas
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to