-print-file-name and -print-prog-name don't aways print full path names, where -print-libgcc-file-name does: [G4:/usr] adriaan% gcc -print-file-name=libgcc libgcc [G4:/usr] adriaan% gcc -print-file-name=libgpc libgpc [G4:/usr] adriaan% gcc -print-prog-name=libgcc libgcc [G4:/usr] adriaan% gcc -print-prog-name=libgpc libgpc [G4:/usr] adriaan% gcc -print-libgcc-file-name /Developer/Pascal/gpc331d2/lib/gcc-lib/powerpc-apple-darwin/3.3.1/libgcc.a [G4:/usr] adriaan% gcc -print-prog-name=cc1 /Developer/Pascal/gpc331d2/lib/gcc-lib/powerpc-apple-darwin/3.3.1/cc1 [G4:/usr] adriaan% gcc -print-prog-name=gpc1 /Developer/Pascal/gpc331d2/lib/gcc-lib/powerpc-apple-darwin/3.3.1/gpc1 [G4:/usr] adriaan% gcc -v Reading specs from /Developer/Pascal/gpc331d2/lib/gcc-lib/powerpc-apple-darwin/3.3.1/specs Configured with: ../gpc-331d2/configure --enable-languages=pascal,c --prefix=/Developer/Pascal/gpc331d2 --enable-threads=posix --target=powerpc-apple-darwin Thread model: posix gcc version 3.3.1 If this is intended behaviour, then the docs are wrong. Regards, Adriaan van Os
I do not think the documenation is wrong or the behaviour you are see either. If I supply the full file name gcc -print-file-name=libgcc.a produces what you wanted: /Users/pinskia/fsf-clean-nocheck/lib/gcc/powerpc-apple-darwin6.6/3.4/libgcc.a
Subject: Re: -print-file-name doesn't aways print full path names pinskia at gcc dot gnu dot org wrote: > If I supply the full file name gcc -print-file-name=libgcc.a produces > what you wanted: > /Users/pinskia/fsf-clean-nocheck/lib/gcc/powerpc-apple-darwin6.6/3.4/ > libgcc.a You are right, I apologize. Regards, Adriaan van Os
Reporter says that he was wrong and he needed the full name rather than the name without the extension which is the way the documentation says.
Perhaps one thing on the man page could be changed, though: -print-file-name=library Print the full absolute name of the library file library that would be used when linking---and don't do anything else. With this option, GCC does not compile or link anything; it just prints the file name. might better read: -print-file-name=library Print the full absolute name of the library file library that would be used when linking---and don't do anything else. With this option, GCC does not compile or link anything. It just prints the file name; The parameter "library" is required to contain the file name ending. Valid examples are: libstdc++.a or libstdc++.dll.