[Module-build-checkins] Module-Build/lib/Module/Build Base.pm,1.481,1.482
Status: Beta
Brought to you by:
kwilliams
|
From: Ken W. <kwi...@us...> - 2005-09-22 18:36:01
|
Update of /cvsroot/module-build/Module-Build/lib/Module/Build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9467/lib/Module/Build Modified Files: Base.pm Log Message: add -DVERSION and -DXS_VERSION compilation flags Index: Base.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Base.pm,v retrieving revision 1.481 retrieving revision 1.482 diff -u -d -r1.481 -r1.482 --- Base.pm 22 Sep 2005 02:39:34 -0000 1.481 +++ Base.pm 22 Sep 2005 18:35:50 -0000 1.482 @@ -3152,17 +3152,23 @@ } sub compile_c { - my ($self, $file) = @_; + my ($self, $file, %args) = @_; my $b = $self->_cbuilder; my $obj_file = $b->object_file($file); $self->add_to_cleanup($obj_file); return $obj_file if $self->up_to_date($file, $obj_file); + # XXX the -D syntax might not be very portable + my $flags = $self->extra_compiler_flags; + if ($args{defines}) { + $flags = [@$flags, map "-D$_=$args{defines}{$_}", keys %{$args{defines}}]; + } + $b->compile(source => $file, object_file => $obj_file, include_dirs => $self->include_dirs, - extra_compiler_flags => $self->extra_compiler_flags, + extra_compiler_flags => $flags, ); return $obj_file; @@ -3279,7 +3285,8 @@ } # .c -> .o - $self->compile_c($c_file); + my $v = $self->dist_version; + $self->compile_c($c_file, defines => {VERSION => $v, XSVERSION => $v}); # The .bs and .a files don't go in blib/lib/, they go in blib/arch/auto/. # Unfortunately we have to pre-compute the whole path. |