Install POD files into "lib\pods" rather than "lib\pod" on Win32
[p5sagit/p5-mst-13.2.git] / lib / ExtUtils / CBuilder / Platform / Windows.pm
index 072791e..b4bb22c 100644 (file)
@@ -90,6 +90,12 @@ sub split_like_shell {
   return @argv;
 }
 
+sub arg_defines {
+  my ($self, %args) = @_;
+  s/"/\\"/g foreach values %args;
+  return map "-D$_=$args{$_}", keys %args;
+}
+
 sub compile {
   my ($self, %args) = @_;
   my $cf = $self->{config};
@@ -101,6 +107,8 @@ sub compile {
 
   $srcdir ||= File::Spec->curdir();
 
+  my @defines = $self->arg_defines( %{ $args{defines} || {} } );
+
   my %spec = (
     srcdir      => $srcdir,
     builddir    => $srcdir,
@@ -111,9 +119,10 @@ sub compile {
     cflags      => [
                      $self->split_like_shell($cf->{ccflags}),
                      $self->split_like_shell($cf->{cccdlflags}),
+                     $self->split_like_shell($cf->{extra_compiler_flags}),
                    ],
     optimize    => [ $self->split_like_shell($cf->{optimize})    ],
-    defines     => [ '' ],
+    defines     => \@defines,
     includes    => [ @{$args{include_dirs} || []} ],
     perlinc     => [
                      $self->perl_inc(),
@@ -260,10 +269,10 @@ sub perl_inc {
 =begin comment
 
 The packages below implement functions for generating properly
-formated commandlines for the compiler being used. Each package
+formatted commandlines for the compiler being used. Each package
 defines two primary functions 'format_linker_cmd()' &
 'format_compiler_cmd()' that accepts a list of named arguments (a
-hash) and returns a list of formated options suitable for invoking the
+hash) and returns a list of formatted options suitable for invoking the
 compiler. By default, if the compiler supports scripting of its
 operation then a script file is built containing the options while
 those options are removed from the commandline, and a reference to the
@@ -308,7 +317,6 @@ sub write_compiler_script {
                                     $spec{basename} . '.ccs' );
 
   $self->add_to_cleanup($script);
-
   print "Generating script '$script'\n" if !$self->{quiet};
 
   open( SCRIPT, ">$script" )