5 unshift @INC, '../lib';
11 open(my $fh,">embed_test.c") || die "Cannot open embed_test.c:$!";
17 my $cc = $Config{'cc'};
18 my $cl = ($^O eq 'MSWin32' && $cc eq 'cl');
19 my $exe = 'embedtest' . $Config{'exe_ext'};
20 my $inc = File::Spec->catdir($INC[0],"..");
21 my $lib = File::Spec->catdir($INC[0],"..");
24 push(@cmd,$cc,"-Fe$exe");
27 push(@cmd,$cc,'-o' => $exe);
29 push(@cmd,"-I$inc",ccopts(),'embed_test.c');
30 if ($^O eq 'MSWin32') {
31 $inc = File::Spec->catdir($inc,'win32');
33 $inc = File::Spec->catdir($inc,'include');
36 push(@cmd,'-link',"-libpath:$lib",$Config{'libperl'},$Config{'libc'});
39 push(@cmd,"-L$lib",'-lperl',$Config{'libc'});
43 push(@cmd,"-L$lib",'-lperl');
49 print "not " if system(join(' ',@cmd));
51 print "not " if system("embed_test");
53 unlink("embed_test","embed_test.c");
55 #gcc -g -I.. -L../ -o perl_test perl_test.c -lperl `../perl -I../lib -MExtUtils::Embed -I../ -e ccopts -e ldopts`
64 #define my_puts(a) if(puts(a) < 0) exit(666)
66 char *cmds[] = { "perl","-e", "print qq[ok 5\\n]", NULL };
68 int main(int argc, char **argv, char **env)
70 PerlInterpreter *my_perl = perl_alloc();
74 perl_construct(my_perl);
78 perl_parse(my_perl, NULL, (sizeof(cmds)/sizeof(char *))-1, cmds, env);
88 perl_destruct(my_perl);