This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: -print-* command-line switches misbehave or are misdocumented
- From: Dave Korn <dave dot korn dot cygwin at googlemail dot com>
- To: Ian Lance Taylor <iant at google dot com>
- Cc: Eli Zaretskii <eliz at gnu dot org>, gcc at gcc dot gnu dot org
- Date: Sun, 05 Jul 2009 00:33:44 +0100
- Subject: Re: -print-* command-line switches misbehave or are misdocumented
- References: <83ljn62id0.fsf@gnu.org> <m3bpo0nj5f.fsf@google.com>
Ian Lance Taylor wrote:
> Eli Zaretskii <eliz@ writes:
>> 3. -print-prog-name: Works only for some programs; manual text
>> misleading.
>>
>> The manual says:
>>
>> `-print-prog-name=PROGRAM'
>> Like `-print-file-name', but searches for a program such as `cpp'.
>>
>> It fails to say what programs will this work with. The example it
>> gives, `cpp' doesn't work:
>>
>> eliz@fencepost:~$ gcc -print-prog-name=cpp
>> cpp
>
> Yeah, that's a clear doc bug. It used to work with "cpp", but not with
> current gcc releases.
>
>> Similarly, it doesn't work with `gcc' itself, which seems a pity,
>> as it doesn't allow to write scripts that discover where GCC
>> lives.
>
> If you are using cachecc or distcc, the question of where GCC lives is
> somewhat ambiguous in any case.
Well, the simple rule is "It can tell you where any program that gcc might
invoke lives", isn't it? That would explain why it can locate cc1, ld and as,
but not gcc or ls, and why it used to be able to locate cpp when it used to
invoke cpp, but not since.
cheers,
DaveK