# from Alberto Simões
# on Saturday 12 June 2010 07:01:

>I am preparing a package that has some C code that needs a full path
>compiled in.
>
>I am using, during Build.PL first run,
>     $builder->install_destination("bin");
>
>But, if the user issues a build install with a different installbase,
>things will not work.
>
>I have two options:
> 1) disable the installbase option to the Build install action
> 2) make the install action recompile everything again

Assuming that it's not feasible to have the C code detect the path at 
runtime (e.g. really must be hard-coded), I would guess that the 
easiest thing is to bail out of the install action if it has an 
install_base which wasn't set at build time.  Of course, this probably 
won't sit well with most users' configurations for installing from the 
CPAN, so making "just works" work would require some tricks.

>>> Is there any problem on using a dispatch("build") during 
>>> ACTION_install? :D 
>>My thought was that it might find everything apparently "up to date"
>>and skip the actual re-build.

Yes, may need to clean and build it all over again (though you would 
probably be changing the datestamps on the relevant sources, so maybe 
it just works.)

Another possibility is to make your hard-coded string a big enough 
boilerplate such that it can be replaced with the (null-padded) actual 
path in the binary.  Sacrificing a 5-1/4" floppy to the portability 
gods is left as an exercise for the reader.

--Eric
-- 
Any sufficiently advanced incompetence is indistinguishable from malice.
--The Napoleon-Clarke Law
---------------------------------------------------
    http://scratchcomputing.com
---------------------------------------------------

Reply via email to