We've had File::Spec in the core since 5.004 and DBI no longer supports 
Perls before 5.005_03, so it seems we ought to use this standard API for 
manipulating file specs.  Note that unexpanded macros cannot reliably be 
passed to these routines because doing so may hide significant syntactic 
elements.  The following gets me building and passing all tests with DEC C 
V5.2-003 on OpenVMS Alpha V7.1, Perl 5.6.1.  Probably best to test on other 
platforms and make sure I haven't bungled anything.

--- Makefile.PL;-0      Wed Feb  6 21:15:46 2002
+++ Makefile.PL Mon Apr 15 11:30:26 2002
@@ -15,6 +15,7 @@
 use Getopt::Long;
 use Config;
 use File::Find;
+use File::Spec;
 use strict;
 
 use Test::Harness;     # tests use it so check it's loadable early
@@ -208,7 +209,7 @@
     # install files that DBD's may need
     File::Find::find( sub {
        $File::Find::prune = 1, return if -d $_ && '.' ne $_;
-       $self->{PM}->{$_} = '$(INST_ARCHAUTODIR)/' . $_
+       $self->{PM}->{$_} = File::Spec->catfile($self->{INST_ARCHAUTODIR}, $_)
            if '.h' eq substr( $_, -2 ) || '.xst' eq substr( $_, -4 );
         }, '.' );
 
@@ -217,6 +218,7 @@
 
 
 sub post_constants {
+    my($self) = shift;
 
     # ensure that Driver.xst and related code gets tested
 
@@ -226,15 +228,14 @@
     }
     my $xst = dbd_postamble();
     $xst =~ s/\$\(BASEEXT\)/Perl/g;
-    my $dir_sep = ($os eq 'MSWin32') ? '\\' : '/';
     $xst .= '
 DBI.c: Perl$(OBJ_EXT)
 
 # make Changes file available as installed pod docs "perldoc DBI::Changes"
-config :: $(INST_LIBDIR)' . $dir_sep . '.exists
-       @$(MKPATH) $(INST_LIBDIR)/DBI
-       @$(RM_F) $(INST_LIBDIR)/DBI/Changes.pm
-       $(CP) Changes $(INST_LIBDIR)/DBI/Changes.pm
+config :: ' . File::Spec->catfile($self->{INST_LIB}, '.exists') . '
+       $(NOECHO) $(MKPATH) ' . File::Spec->catdir($self->{INST_LIB}, 'DBI') . '
+       $(NOECHO) $(RM_F) ' . File::Spec->catfile($self->{INST_LIB}, 'DBI', 
+'Changes.pm') . '
+       $(CP) Changes ' . File::Spec->catfile($self->{INST_LIB}, 'DBI', 'Changes.pm') 
+. '
 ';
 
     return $xst;
[end of patch]

Reply via email to