Kwindla Hultman Kramer wrote:
> 
> Thanks again for your help. I buy your assertion that jumping through
> hoops to allow auto-installable modules that call Inline code from
> eval statements is a little much!
> 
> You were right about how to order my BEGIN and use statements.
> 
> I settled on the following, as very nearly like a "site-install" (as
> long as the tmp_directory is set properly and 'make test' is run as
> root):
> 
>   use Inline C => $code,
>     DIRECTORY => XML::Comma->tmp_directory();

Kwindla,

I hope you don't mind me replying to the mailing list, but I feel all
should hear about this. I am not sure of exactly what you're doing here,
but I'm going to take a guess and offer you (all) some helpful advice.

1) The " 'make test' is run as root" thing sets off some alarms. Let me
clarify this now: The Inline extension gets compiled at 'make' time, not
during 'make test'. This is an important distinction. Inline used to
build during 'make test' when you used SITE_INSTALL. This was a
quick-hack-solution on my part. I've felt for a long time that compiling
during 'make test' has a bad decision. If Inline is to replace XS, it
must do the right thing at the right time. 0.40 fixes all that. The
Inline::MakeMaker grabs control from ExtUtils::MakeMaker long enough to
insert a rule for building your extension at 'make' time.

NOTE: Now of course if you typed 'make test' before 'make' it would do
an implicit 'make' by definition.

2) So if you are trying to put something in the your Perl's site tree
simply follow my previous instructions and run:

    perl Makefile.PL
    make
    make test
    make install

or

    sudo make install     # if your Perl is installed as root.

3) If you just want to install to a local site tree that is, say, in
your home directory:

    perl Makefile.PL PREFIX=/home/kwindla/myperl
    make
    make test
    make install
    make purge    # cleans up all the mess including Inline's. very
handy. 
    export
PERL5LIB=/home/kwindla/myperl/lib/site_perl/5.6.1/i686-linux-thread-multi

Even though there's more than one way to do it, these are the guidelines
that are standard, appropriate, accepted. and scalable. Sometimes there
is a *right* way to do it. And Inline is all set up to "play ball" with
these mechanisms.

Read 'perldoc ExtUtils::MakMaker' for more info.

---

If I am totally missing the point of your goals, let me know.

Best wishes, Brian

-- 
perl -le 'use Inline C=>q{SV*JAxH(char*x){return newSVpvf
("Just Another %s Hacker",x);}};print JAxH+Perl'

Reply via email to