Patrick Dupre wrote: > On Fri, 22 Aug 2008, Rob Dixon wrote: > >> Patrick Dupre wrote: >>> How can I modify my Makefile.PL to have a Makefile which can make >>> cc -o test.o -c test.c `perl -MExtUtils::Embed -e ccopts` >>> >>> Thank >> Makefile.PL is a program written using ExtUtils::MakeMaker to generate a >> makefile for building a Perl /extension/ module. >> >> ExtUtils::Embed is a module that will generate C code and compile/link >> options >> for /embedding/ a perl interpreter into a C program. >> >> Extending and embedding Perl are two very different, almost opposite ideas. >> >> Since it looks like you have a program called test.c I assume you want to >> embed >> a perl interpreter into that program, and if so you can forget about >> Makefile.PL. But in that case what are you asking? You clearly know how to >> compile test.c as you have written it in your post, and it is >> straightforward to >> write a makefile to do that if you want to. >> >> So what help do you need from us? >> > > In fact, I have a Makefile.Pl because I am using ExtUtils to generate > c for perl (with xs), but I also need to call a perl subroutine for c !! > I know, it may be not elegant, but it is where I am !! > > So I need the Makefile.PL correct to generate the lib for perl > and to compile the c to have it be able to call perl.
So you are embedding a perl interpreter into an XS extension because you need to call a Perl subroutine from that extension. Is that right? If so then you should just be able to manipulate the Perl stack and make the call using call_sv or similar. Take a look at perldoc perlcall for help on this. Or let me know if I'm not understanding you correctly. Rob -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/