File pyperl-1.0.1d-makefile.pl-fixes.patch of Package python-perlmodule
--- pyperl-1.0.1d/Python-Object/Makefile.PL.orig 2007-10-16 11:42:39.000000000 +0200
+++ pyperl-1.0.1d/Python-Object/Makefile.PL 2007-10-19 20:49:02.000000000 +0200
@@ -1,8 +1,8 @@
use ExtUtils::MakeMaker;
-chomp(my $pyinc = `python ./pyinc.py`);
-
-print "Picking up pyton include files from \"$pyinc\"\n";
+chomp(my $pyinc = `python-config --includes`);
+chomp(my $pylib = `python-config --libs`);
+chomp(my $pysitelib = `python -c 'from distutils.sysconfig import get_python_lib; print get_python_lib(1)'`);
my @define;
my @libs;
@@ -11,16 +11,8 @@ push(@define, "MULTI_PERL") if -f "../MU
if (-f "../BOOT_FROM_PERL") {
push(@define, "BOOT_FROM_PERL");
-
- # XXX need to find the location of python.a, and this
- # is obviously not the right way...
- my $pylib = $pyinc;
- $pylib =~ s/include/lib/;
- $pylib =~ m,/(python[^/]+)$, || die;
- $pylib .= "/config";
- push(@libs, "-L$pylib -l$1");
-
- push(@extra, OBJECT => "Object.o /local/python/1.5.2-thr/lib/python1.5/site-packages/perl.so");
+ push(@libs, $pylib);
+ push(@extra, OBJECT => "Object.o $pysitelib/perl.so");
}
if ($^O eq 'MSWin32') {
@@ -46,7 +38,7 @@ if (@libs) {
WriteMakefile(
NAME => 'Python::Object',
VERSION_FROM => 'Object.pm',
- INC => "-I\"$pyinc\"",
+ INC => $pyinc,
@extra,
dist => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', },
);