Thanks for the proposed Makefile.PL
Why do you think this Makefile.PL is better than the
one I put on the Cookbook? Maybe we could do a merge
of both, but for that I would like to know the reasons
behind your Makefile.PL
One of the advantages of the Cookbook one is that you
can see the compilation lines and you can thus modify them
with the necessary switches. It is more user friendly.
Cheers,
Xavier
On 2/21/07, Vanuxem Grégory <[EMAIL PROTECTED]> wrote:
Le mercredi 21 février 2007 à 15:27 -0600, Phuong, Guy a écrit :
[...]
> /usr/bin/ld: suma.o: relocation R_X86_64_PC32 against `cos@@GLIBC_2.2.5' can
> not be used when making a shared object; recompile with -fPIC
> /usr/bin/ld: final link failed: Bad value
> collect2: ld returned 1 exit status
> make: *** [blib/arch/auto/PDL/Suma/Suma.so] Error 1
As stated here you have to compile suma.c with -fPIC in CFLAGS (an
option to cc). See the Makefile.PL and add this option (after
$Config{'cc'}). The correct way would be to use $Config{'cccdlflags'} I
believe.
Greg
PS : Xavier what about this one for an example of a Makefile.PL with
additional C files compiled with the Perl settings (probably adapted
from the PDL distribution):
# Use this as a template for the Makefile.PL for
# any external PDL module.
use ExtUtils::MakeMaker;
use PDL::Core::Dev;
@pack = (["mymodule.pd",Mymodule,PDL::Mymodule]);
%hash = pdlpp_stdargs(@::pack);
# $hash{'OPTIMIZE'} = '-g'; # If you want to debug, uncomment this.
# $hash{INC} .= " -I/usr/local/include"; # uncomment as required
# $hash{LIBS}[0] .= " -L/usr/local/lib -lmylib "; # uncomment as
required
for $file ( qw( myfile ) ) {
my $n = "$file\$(OBJ_EXT)";
$hash{OBJECT} .= " $n";
$hash{clean}{FILES} .= " $n";
}
@prereq = (
PDL => "2.4.0",
);
WriteMakefile(
%hash,
'NAME' => 'PDL::Mymodule',
'VERSION' => 0.01,
'PREREQ_PM' => [EMAIL PROTECTED], # e.g., Module::Name => 1.1
($] ge '5.005') ? (
'AUTHOR' => 'My name , ([EMAIL PROTECTED])',
) : (),
);
# Add genpp rule
# add other makefile additions as required (see also
ExtUtils::MakeMaker)
sub MY::postamble {
pdlpp_postamble(@::pack);
}
___________________________________________________________________________
Yahoo! Mail réinvente le mail ! Découvrez le nouveau Yahoo! Mail et son
interface révolutionnaire.
http://fr.mail.yahoo.com
_______________________________________________
Perldl mailing list
[email protected]
http://mailman.jach.hawaii.edu/mailman/listinfo/perldl