On Thu, 14 Jun 2001, Piers Harding wrote:
> Hi Neil,
>
> Thanks for taking the time.
>
> Initially it didn't work, until I fully qualified the path to the gcc,
> and then it worked a charm. I am wondering if it is something to do
> with the shell used to execute the make in, as I am using bash, and
> not the /sbin/sh default for HP-UX. This also means that the only
> reference to the gcc is in my own .profile file PATH definition.
>
> Is this a possible cause?
It's not only possible, it's probable. I'm not sure if there's an easier
way of finding the compiler other than hard-coding it. On the plus side,
you only have to define this value once in your script:
use Inline Config => CC => '/path/to/gcc';
use Inline C; # both of these invocations
use Inline C; # know where CC lives
The problem here is that Inline::C's Makefile.PL searches for the compiler
by looking at $ENV{PATH}. But there's no guarantee that your path is the
same as the path found when actually compiling code. The Makefile.PL could
compare $ENV{SHELL} to $Config{sh} and warn you of this possibility if
they're different, I suppose...
(I get around this issue in Inline::CPP by guessing the guessing the
compiler location, prompting the user, and hard-wiring the info into
CPP.pm, which is just as hideous. There are much better ways of doing it,
like storing values in config files that get installed or using
Inline::Files.)
We-should-add-support-for-~/.inlinerc-ly,
Neil