]> granicus.if.org Git - postgresql/commitdiff
Replace backslashes by forward slashes in MSVC build code
authorPeter Eisentraut <peter_e@gmx.net>
Sat, 25 Apr 2015 12:52:03 +0000 (08:52 -0400)
committerPeter Eisentraut <peter_e@gmx.net>
Sat, 25 Apr 2015 12:58:01 +0000 (08:58 -0400)
This makes it possible to run some stages of these build scripts on
non-Windows systems.  That way, we can more easily test whether file
moves or makefile changes might break the MSVC build.

Peter Eisentraut and Michael Paquier

src/tools/msvc/MSBuildProject.pm
src/tools/msvc/Mkvcbuild.pm
src/tools/msvc/Project.pm
src/tools/msvc/Solution.pm

index 37958f95b558f7b8ac803b3873b76db18e1ddf66..a16f9acefcabea0229778951d50b43ff272cd45e 100644 (file)
@@ -127,7 +127,7 @@ EOF
        foreach my $fileNameWithPath (sort keys %{ $self->{files} })
        {
                confess "Bad format filename '$fileNameWithPath'\n"
-                 unless ($fileNameWithPath =~ /^(.*)\\([^\\]+)\.(c|cpp|y|l|rc)$/);
+                 unless ($fileNameWithPath =~ m!^(.*)/([^/]+)\.(c|cpp|y|l|rc)$!);
                my $dir      = $1;
                my $fileName = $2;
                if ($fileNameWithPath =~ /\.y$/ or $fileNameWithPath =~ /\.l$/)
index f5b97390f85bcab1006f65c6b2089ccc5937a92a..344b75ff82b828a2695d458096ce78d30dab842e 100644 (file)
@@ -33,10 +33,12 @@ my $contrib_defines = { 'refint' => 'REFINT_VERBOSE' };
 my @contrib_uselibpq =
   ('dblink', 'oid2name', 'postgres_fdw', 'vacuumlo');
 my @contrib_uselibpgport = (
+       'chkpass',
        'oid2name',
        'pg_standby',
        'vacuumlo');
 my @contrib_uselibpgcommon = (
+       'chkpass',
        'oid2name',
        'pg_standby',
        'vacuumlo');
@@ -44,8 +46,8 @@ my $contrib_extralibs = undef;
 my $contrib_extraincludes =
   { 'tsearch2' => ['contrib/tsearch2'], 'dblink' => ['src/backend'] };
 my $contrib_extrasource = {
-       'cube' => [ 'contrib\cube\cubescan.l', 'contrib\cube\cubeparse.y' ],
-       'seg' => [ 'contrib\seg\segscan.l', 'contrib\seg\segparse.y' ], };
+       'cube' => [ 'contrib/cube/cubescan.l', 'contrib/cube/cubeparse.y' ],
+       'seg' => [ 'contrib/seg/segscan.l', 'contrib/seg/segparse.y' ], };
 my @contrib_excludes = ('pgcrypto', 'commit_ts', 'intagg', 'sepgsql');
 
 # Set of variables for frontend modules
@@ -59,12 +61,12 @@ my $frontend_extralibs = {
        'pgbench'    => ['ws2_32.lib'],
        'psql'       => ['ws2_32.lib'] };
 my $frontend_extraincludes = {
-       'initdb' => ['src\timezone'],
-       'psql'   => [ 'src\bin\pg_dump', 'src\backend' ] };
+       'initdb' => ['src/timezone'],
+       'psql'   => [ 'src/bin/pg_dump', 'src/backend' ] };
 my $frontend_extrasource = {
-       'psql' => ['src\bin\psql\psqlscan.l'],
+       'psql' => ['src/bin/psql/psqlscan.l'],
        'pgbench' =>
-               [ 'src\bin\pgbench\exprscan.l', 'src\bin\pgbench\exprparse.y' ],
+               [ 'src/bin/pgbench/exprscan.l', 'src/bin/pgbench/exprparse.y' ],
 };
 my @frontend_excludes =
   ('pgevent', 'pg_basebackup', 'pg_rewind', 'pg_dump', 'pg_xlogdump', 'scripts');
@@ -73,9 +75,9 @@ sub mkvcbuild
 {
        our $config = shift;
 
-       chdir('..\..\..') if (-d '..\msvc' && -d '..\..\..\src');
+       chdir('../../..') if (-d '../msvc' && -d '../../../src');
        die 'Must run from root or msvc directory'
-         unless (-d 'src\tools\msvc' && -d 'src');
+         unless (-d 'src/tools/msvc' && -d 'src');
 
        my $vsVersion = DetermineVisualStudioVersion();
 
@@ -114,37 +116,37 @@ sub mkvcbuild
 
        $libpgport = $solution->AddProject('libpgport', 'lib', 'misc');
        $libpgport->AddDefine('FRONTEND');
-       $libpgport->AddFiles('src\port', @pgportfiles);
+       $libpgport->AddFiles('src/port', @pgportfiles);
 
        $libpgcommon = $solution->AddProject('libpgcommon', 'lib', 'misc');
        $libpgcommon->AddDefine('FRONTEND');
-       $libpgcommon->AddFiles('src\common', @pgcommonfrontendfiles);
+       $libpgcommon->AddFiles('src/common', @pgcommonfrontendfiles);
 
-       $postgres = $solution->AddProject('postgres', 'exe', '', 'src\backend');
-       $postgres->AddIncludeDir('src\backend');
-       $postgres->AddDir('src\backend\port\win32');
-       $postgres->AddFile('src\backend\utils\fmgrtab.c');
+       $postgres = $solution->AddProject('postgres', 'exe', '', 'src/backend');
+       $postgres->AddIncludeDir('src/backend');
+       $postgres->AddDir('src/backend/port/win32');
+       $postgres->AddFile('src/backend/utils/fmgrtab.c');
        $postgres->ReplaceFile(
-               'src\backend\port\dynloader.c',
-               'src\backend\port\dynloader\win32.c');
-       $postgres->ReplaceFile('src\backend\port\pg_sema.c',
-               'src\backend\port\win32_sema.c');
-       $postgres->ReplaceFile('src\backend\port\pg_shmem.c',
-               'src\backend\port\win32_shmem.c');
-       $postgres->ReplaceFile('src\backend\port\pg_latch.c',
-               'src\backend\port\win32_latch.c');
-       $postgres->AddFiles('src\port',   @pgportfiles);
-       $postgres->AddFiles('src\common', @pgcommonbkndfiles);
-       $postgres->AddDir('src\timezone');
-
-       # We need source files from src\timezone, but that directory's resource
+               'src/backend/port/dynloader.c',
+               'src/backend/port/dynloader/win32.c');
+       $postgres->ReplaceFile('src/backend/port/pg_sema.c',
+               'src/backend/port/win32_sema.c');
+       $postgres->ReplaceFile('src/backend/port/pg_shmem.c',
+               'src/backend/port/win32_shmem.c');
+       $postgres->ReplaceFile('src/backend/port/pg_latch.c',
+               'src/backend/port/win32_latch.c');
+       $postgres->AddFiles('src/port',   @pgportfiles);
+       $postgres->AddFiles('src/common', @pgcommonbkndfiles);
+       $postgres->AddDir('src/timezone');
+
+       # We need source files from src/timezone, but that directory's resource
        # file pertains to "zic", not to the backend.
-       $postgres->RemoveFile('src\timezone\win32ver.rc');
-       $postgres->AddFiles('src\backend\parser', 'scan.l', 'gram.y');
-       $postgres->AddFiles('src\backend\bootstrap', 'bootscanner.l',
+       $postgres->RemoveFile('src/timezone/win32ver.rc');
+       $postgres->AddFiles('src/backend/parser', 'scan.l', 'gram.y');
+       $postgres->AddFiles('src/backend/bootstrap', 'bootscanner.l',
                'bootparse.y');
-       $postgres->AddFiles('src\backend\utils\misc', 'guc-file.l');
-       $postgres->AddFiles('src\backend\replication', 'repl_scanner.l',
+       $postgres->AddFiles('src/backend/utils/misc', 'guc-file.l');
+       $postgres->AddFiles('src/backend/replication', 'repl_scanner.l',
                'repl_gram.y');
        $postgres->AddDefine('BUILDING_DLL');
        $postgres->AddLibrary('secur32.lib');
@@ -156,31 +158,31 @@ sub mkvcbuild
    # if building without OpenSSL
        if (!$solution->{options}->{openssl})
        {
-               $postgres->RemoveFile('src\backend\libpq\be-secure-openssl.c');
+               $postgres->RemoveFile('src/backend/libpq/be-secure-openssl.c');
        }
 
        my $snowball = $solution->AddProject('dict_snowball', 'dll', '',
-               'src\backend\snowball');
+               'src/backend/snowball');
 
        # This Makefile uses VPATH to find most source files in a subdirectory.
        $snowball->RelocateFiles(
-               'src\backend\snowball\libstemmer',
+               'src/backend/snowball/libstemmer',
                sub {
                        return shift !~ /(dict_snowball.c|win32ver.rc)$/;
                });
-       $snowball->AddIncludeDir('src\include\snowball');
+       $snowball->AddIncludeDir('src/include/snowball');
        $snowball->AddReference($postgres);
 
        my $plpgsql =
-         $solution->AddProject('plpgsql', 'dll', 'PLs', 'src\pl\plpgsql\src');
-       $plpgsql->AddFiles('src\pl\plpgsql\src', 'pl_gram.y');
+         $solution->AddProject('plpgsql', 'dll', 'PLs', 'src/pl/plpgsql/src');
+       $plpgsql->AddFiles('src/pl/plpgsql/src', 'pl_gram.y');
        $plpgsql->AddReference($postgres);
 
        if ($solution->{options}->{perl})
        {
-               my $plperlsrc = "src\\pl\\plperl\\";
+               my $plperlsrc = "src/pl/plperl/";
                my $plperl =
-                 $solution->AddProject('plperl', 'dll', 'PLs', 'src\pl\plperl');
+                 $solution->AddProject('plperl', 'dll', 'PLs', 'src/pl/plperl');
                $plperl->AddIncludeDir($solution->{options}->{perl} . '/lib/CORE');
                $plperl->AddDefine('PLPERL_HAVE_UID_GID');
                foreach my $xs ('SPI.xs', 'Util.xs')
@@ -188,7 +190,7 @@ sub mkvcbuild
                        (my $xsc = $xs) =~ s/\.xs/.c/;
                        if (Solution::IsNewer("$plperlsrc$xsc", "$plperlsrc$xs"))
                        {
-                               my $xsubppdir = first { -e "$_\\ExtUtils\\xsubpp" } @INC;
+                               my $xsubppdir = first { -e "$_/ExtUtils/xsubpp" } @INC;
                                print "Building $plperlsrc$xsc...\n";
                                system( $solution->{options}->{perl}
                                          . '/bin/perl '
@@ -205,15 +207,15 @@ sub mkvcbuild
                        }
                }
                if (Solution::IsNewer(
-                               'src\pl\plperl\perlchunks.h',
-                               'src\pl\plperl\plc_perlboot.pl')
+                               'src/pl/plperl/perlchunks.h',
+                               'src/pl/plperl/plc_perlboot.pl')
                        || Solution::IsNewer(
-                               'src\pl\plperl\perlchunks.h',
-                               'src\pl\plperl\plc_trusted.pl'))
+                               'src/pl/plperl/perlchunks.h',
+                               'src/pl/plperl/plc_trusted.pl'))
                {
-                       print 'Building src\pl\plperl\perlchunks.h ...' . "\n";
+                       print 'Building src/pl/plperl/perlchunks.h ...' . "\n";
                        my $basedir = getcwd;
-                       chdir 'src\pl\plperl';
+                       chdir 'src/pl/plperl';
                        system( $solution->{options}->{perl}
                                  . '/bin/perl '
                                  . 'text2macro.pl '
@@ -221,29 +223,29 @@ sub mkvcbuild
                                  . 'plc_perlboot.pl plc_trusted.pl '
                                  . '>perlchunks.h');
                        chdir $basedir;
-                       if ((!(-f 'src\pl\plperl\perlchunks.h'))
-                               || -z 'src\pl\plperl\perlchunks.h')
+                       if ((!(-f 'src/pl/plperl/perlchunks.h'))
+                               || -z 'src/pl/plperl/perlchunks.h')
                        {
-                               unlink('src\pl\plperl\perlchunks.h');    # if zero size
+                               unlink('src/pl/plperl/perlchunks.h');    # if zero size
                                die 'Failed to create perlchunks.h' . "\n";
                        }
                }
                if (Solution::IsNewer(
-                               'src\pl\plperl\plperl_opmask.h',
-                               'src\pl\plperl\plperl_opmask.pl'))
+                               'src/pl/plperl/plperl_opmask.h',
+                               'src/pl/plperl/plperl_opmask.pl'))
                {
-                       print 'Building src\pl\plperl\plperl_opmask.h ...' . "\n";
+                       print 'Building src/pl/plperl/plperl_opmask.h ...' . "\n";
                        my $basedir = getcwd;
-                       chdir 'src\pl\plperl';
+                       chdir 'src/pl/plperl';
                        system( $solution->{options}->{perl}
                                  . '/bin/perl '
                                  . 'plperl_opmask.pl '
                                  . 'plperl_opmask.h');
                        chdir $basedir;
-                       if ((!(-f 'src\pl\plperl\plperl_opmask.h'))
-                               || -z 'src\pl\plperl\plperl_opmask.h')
+                       if ((!(-f 'src/pl/plperl/plperl_opmask.h'))
+                               || -z 'src/pl/plperl/plperl_opmask.h')
                        {
-                               unlink('src\pl\plperl\plperl_opmask.h');    # if zero size
+                               unlink('src/pl/plperl/plperl_opmask.h');    # if zero size
                                die 'Failed to create plperl_opmask.h' . "\n";
                        }
                }
@@ -283,89 +285,89 @@ sub mkvcbuild
 
                my $pymajorver = substr($pyver, 0, 1);
                my $plpython = $solution->AddProject('plpython' . $pymajorver,
-                       'dll', 'PLs', 'src\pl\plpython');
-               $plpython->AddIncludeDir($pyprefix . '\include');
-               $plpython->AddLibrary($pyprefix . "\\Libs\\python$pyver.lib");
+                       'dll', 'PLs', 'src/pl/plpython');
+               $plpython->AddIncludeDir($pyprefix . '/include');
+               $plpython->AddLibrary($pyprefix . "/Libs/python$pyver.lib");
                $plpython->AddReference($postgres);
        }
 
        if ($solution->{options}->{tcl})
        {
                my $pltcl =
-                 $solution->AddProject('pltcl', 'dll', 'PLs', 'src\pl\tcl');
-               $pltcl->AddIncludeDir($solution->{options}->{tcl} . '\include');
+                 $solution->AddProject('pltcl', 'dll', 'PLs', 'src/pl/tcl');
+               $pltcl->AddIncludeDir($solution->{options}->{tcl} . '/include');
                $pltcl->AddReference($postgres);
-               if (-e $solution->{options}->{tcl} . '\lib\tcl85.lib')
+               if (-e $solution->{options}->{tcl} . '/lib/tcl85.lib')
                {
                        $pltcl->AddLibrary(
-                               $solution->{options}->{tcl} . '\lib\tcl85.lib');
+                               $solution->{options}->{tcl} . '/lib/tcl85.lib');
                }
                else
                {
                        $pltcl->AddLibrary(
-                               $solution->{options}->{tcl} . '\lib\tcl84.lib');
+                               $solution->{options}->{tcl} . '/lib/tcl84.lib');
                }
        }
 
        $libpq = $solution->AddProject('libpq', 'dll', 'interfaces',
-               'src\interfaces\libpq');
+               'src/interfaces/libpq');
        $libpq->AddDefine('FRONTEND');
        $libpq->AddDefine('UNSAFE_STAT_OK');
-       $libpq->AddIncludeDir('src\port');
+       $libpq->AddIncludeDir('src/port');
        $libpq->AddLibrary('secur32.lib');
        $libpq->AddLibrary('ws2_32.lib');
        $libpq->AddLibrary('wldap32.lib') if ($solution->{options}->{ldap});
-       $libpq->UseDef('src\interfaces\libpq\libpqdll.def');
-       $libpq->ReplaceFile('src\interfaces\libpq\libpqrc.c',
-               'src\interfaces\libpq\libpq.rc');
+       $libpq->UseDef('src/interfaces/libpq/libpqdll.def');
+       $libpq->ReplaceFile('src/interfaces/libpq/libpqrc.c',
+               'src/interfaces/libpq/libpq.rc');
        $libpq->AddReference($libpgport);
 
    # The OBJS scraper doesn't know about ifdefs, so remove fe-secure-openssl.c
    # if building without OpenSSL
        if (!$solution->{options}->{openssl})
        {
-               $libpq->RemoveFile('src\interfaces\libpq\fe-secure-openssl.c');
+               $libpq->RemoveFile('src/interfaces/libpq/fe-secure-openssl.c');
        }
 
        my $libpqwalreceiver =
          $solution->AddProject('libpqwalreceiver', 'dll', '',
-               'src\backend\replication\libpqwalreceiver');
-       $libpqwalreceiver->AddIncludeDir('src\interfaces\libpq');
+               'src/backend/replication/libpqwalreceiver');
+       $libpqwalreceiver->AddIncludeDir('src/interfaces/libpq');
        $libpqwalreceiver->AddReference($postgres, $libpq);
 
        my $pgtypes = $solution->AddProject(
                'libpgtypes', 'dll',
-               'interfaces', 'src\interfaces\ecpg\pgtypeslib');
+               'interfaces', 'src/interfaces/ecpg/pgtypeslib');
        $pgtypes->AddDefine('FRONTEND');
        $pgtypes->AddReference($libpgport);
-       $pgtypes->UseDef('src\interfaces\ecpg\pgtypeslib\pgtypeslib.def');
-       $pgtypes->AddIncludeDir('src\interfaces\ecpg\include');
+       $pgtypes->UseDef('src/interfaces/ecpg/pgtypeslib/pgtypeslib.def');
+       $pgtypes->AddIncludeDir('src/interfaces/ecpg/include');
 
        my $libecpg = $solution->AddProject('libecpg', 'dll', 'interfaces',
-               'src\interfaces\ecpg\ecpglib');
+               'src/interfaces/ecpg/ecpglib');
        $libecpg->AddDefine('FRONTEND');
-       $libecpg->AddIncludeDir('src\interfaces\ecpg\include');
-       $libecpg->AddIncludeDir('src\interfaces\libpq');
-       $libecpg->AddIncludeDir('src\port');
-       $libecpg->UseDef('src\interfaces\ecpg\ecpglib\ecpglib.def');
+       $libecpg->AddIncludeDir('src/interfaces/ecpg/include');
+       $libecpg->AddIncludeDir('src/interfaces/libpq');
+       $libecpg->AddIncludeDir('src/port');
+       $libecpg->UseDef('src/interfaces/ecpg/ecpglib/ecpglib.def');
        $libecpg->AddLibrary('ws2_32.lib');
        $libecpg->AddReference($libpq, $pgtypes, $libpgport);
 
        my $libecpgcompat = $solution->AddProject(
                'libecpg_compat', 'dll',
-               'interfaces',     'src\interfaces\ecpg\compatlib');
+               'interfaces',     'src/interfaces/ecpg/compatlib');
        $libecpgcompat->AddDefine('FRONTEND');
-       $libecpgcompat->AddIncludeDir('src\interfaces\ecpg\include');
-       $libecpgcompat->AddIncludeDir('src\interfaces\libpq');
-       $libecpgcompat->UseDef('src\interfaces\ecpg\compatlib\compatlib.def');
+       $libecpgcompat->AddIncludeDir('src/interfaces/ecpg/include');
+       $libecpgcompat->AddIncludeDir('src/interfaces/libpq');
+       $libecpgcompat->UseDef('src/interfaces/ecpg/compatlib/compatlib.def');
        $libecpgcompat->AddReference($pgtypes, $libecpg, $libpgport);
 
        my $ecpg = $solution->AddProject('ecpg', 'exe', 'interfaces',
-               'src\interfaces\ecpg\preproc');
-       $ecpg->AddIncludeDir('src\interfaces\ecpg\include');
-       $ecpg->AddIncludeDir('src\interfaces\libpq');
-       $ecpg->AddPrefixInclude('src\interfaces\ecpg\preproc');
-       $ecpg->AddFiles('src\interfaces\ecpg\preproc', 'pgc.l', 'preproc.y');
+               'src/interfaces/ecpg/preproc');
+       $ecpg->AddIncludeDir('src/interfaces/ecpg/include');
+       $ecpg->AddIncludeDir('src/interfaces/libpq');
+       $ecpg->AddPrefixInclude('src/interfaces/ecpg/preproc');
+       $ecpg->AddFiles('src/interfaces/ecpg/preproc', 'pgc.l', 'preproc.y');
        $ecpg->AddDefine('MAJOR_VERSION=4');
        $ecpg->AddDefine('MINOR_VERSION=11');
        $ecpg->AddDefine('PATCHLEVEL=0');
@@ -374,39 +376,39 @@ sub mkvcbuild
 
        my $pgregress_ecpg =
          $solution->AddProject('pg_regress_ecpg', 'exe', 'misc');
-       $pgregress_ecpg->AddFile('src\interfaces\ecpg\test\pg_regress_ecpg.c');
-       $pgregress_ecpg->AddFile('src\test\regress\pg_regress.c');
-       $pgregress_ecpg->AddIncludeDir('src\port');
-       $pgregress_ecpg->AddIncludeDir('src\test\regress');
+       $pgregress_ecpg->AddFile('src/interfaces/ecpg/test/pg_regress_ecpg.c');
+       $pgregress_ecpg->AddFile('src/test/regress/pg_regress.c');
+       $pgregress_ecpg->AddIncludeDir('src/port');
+       $pgregress_ecpg->AddIncludeDir('src/test/regress');
        $pgregress_ecpg->AddDefine('HOST_TUPLE="i686-pc-win32vc"');
        $pgregress_ecpg->AddLibrary('ws2_32.lib');
-       $pgregress_ecpg->AddDirResourceFile('src\interfaces\ecpg\test');
+       $pgregress_ecpg->AddDirResourceFile('src/interfaces/ecpg/test');
        $pgregress_ecpg->AddReference($libpgcommon, $libpgport);
 
        my $isolation_tester =
          $solution->AddProject('isolationtester', 'exe', 'misc');
-       $isolation_tester->AddFile('src\test\isolation\isolationtester.c');
-       $isolation_tester->AddFile('src\test\isolation\specparse.y');
-       $isolation_tester->AddFile('src\test\isolation\specscanner.l');
-       $isolation_tester->AddFile('src\test\isolation\specparse.c');
-       $isolation_tester->AddIncludeDir('src\test\isolation');
-       $isolation_tester->AddIncludeDir('src\port');
-       $isolation_tester->AddIncludeDir('src\test\regress');
-       $isolation_tester->AddIncludeDir('src\interfaces\libpq');
+       $isolation_tester->AddFile('src/test/isolation/isolationtester.c');
+       $isolation_tester->AddFile('src/test/isolation/specparse.y');
+       $isolation_tester->AddFile('src/test/isolation/specscanner.l');
+       $isolation_tester->AddFile('src/test/isolation/specparse.c');
+       $isolation_tester->AddIncludeDir('src/test/isolation');
+       $isolation_tester->AddIncludeDir('src/port');
+       $isolation_tester->AddIncludeDir('src/test/regress');
+       $isolation_tester->AddIncludeDir('src/interfaces/libpq');
        $isolation_tester->AddDefine('HOST_TUPLE="i686-pc-win32vc"');
        $isolation_tester->AddLibrary('ws2_32.lib');
-       $isolation_tester->AddDirResourceFile('src\test\isolation');
+       $isolation_tester->AddDirResourceFile('src/test/isolation');
        $isolation_tester->AddReference($libpq, $libpgcommon, $libpgport);
 
        my $pgregress_isolation =
          $solution->AddProject('pg_isolation_regress', 'exe', 'misc');
-       $pgregress_isolation->AddFile('src\test\isolation\isolation_main.c');
-       $pgregress_isolation->AddFile('src\test\regress\pg_regress.c');
-       $pgregress_isolation->AddIncludeDir('src\port');
-       $pgregress_isolation->AddIncludeDir('src\test\regress');
+       $pgregress_isolation->AddFile('src/test/isolation/isolation_main.c');
+       $pgregress_isolation->AddFile('src/test/regress/pg_regress.c');
+       $pgregress_isolation->AddIncludeDir('src/port');
+       $pgregress_isolation->AddIncludeDir('src/test/regress');
        $pgregress_isolation->AddDefine('HOST_TUPLE="i686-pc-win32vc"');
        $pgregress_isolation->AddLibrary('ws2_32.lib');
-       $pgregress_isolation->AddDirResourceFile('src\test\isolation');
+       $pgregress_isolation->AddDirResourceFile('src/test/isolation');
        $pgregress_isolation->AddReference($libpgcommon, $libpgport);
 
        # src/bin
@@ -421,40 +423,40 @@ sub mkvcbuild
        }
 
        my $pgbasebackup = AddSimpleFrontend('pg_basebackup', 1);
-       $pgbasebackup->AddFile('src\bin\pg_basebackup\pg_basebackup.c');
+       $pgbasebackup->AddFile('src/bin/pg_basebackup/pg_basebackup.c');
        $pgbasebackup->AddLibrary('ws2_32.lib');
 
        my $pgreceivexlog = AddSimpleFrontend('pg_basebackup', 1);
        $pgreceivexlog->{name} = 'pg_receivexlog';
-       $pgreceivexlog->AddFile('src\bin\pg_basebackup\pg_receivexlog.c');
+       $pgreceivexlog->AddFile('src/bin/pg_basebackup/pg_receivexlog.c');
        $pgreceivexlog->AddLibrary('ws2_32.lib');
 
        my $pgrecvlogical = AddSimpleFrontend('pg_basebackup', 1);
        $pgrecvlogical->{name} = 'pg_recvlogical';
-       $pgrecvlogical->AddFile('src\bin\pg_basebackup\pg_recvlogical.c');
+       $pgrecvlogical->AddFile('src/bin/pg_basebackup/pg_recvlogical.c');
        $pgrecvlogical->AddLibrary('ws2_32.lib');
 
        my $pgrewind = AddSimpleFrontend('pg_rewind', 1);
        $pgrewind->{name} = 'pg_rewind';
-       $pgrewind->AddFile('src\backend\access\transam\xlogreader.c');
+       $pgrewind->AddFile('src/backend/access/transam/xlogreader.c');
        $pgrewind->AddLibrary('ws2_32.lib');
        $pgrewind->AddDefine('FRONTEND');
 
        my $pgevent = $solution->AddProject('pgevent', 'dll', 'bin');
-       $pgevent->AddFiles('src\bin\pgevent', 'pgevent.c', 'pgmsgevent.rc');
-       $pgevent->AddResourceFile('src\bin\pgevent', 'Eventlog message formatter',
+       $pgevent->AddFiles('src/bin/pgevent', 'pgevent.c', 'pgmsgevent.rc');
+       $pgevent->AddResourceFile('src/bin/pgevent', 'Eventlog message formatter',
                'win32');
-       $pgevent->RemoveFile('src\bin\pgevent\win32ver.rc');
-       $pgevent->UseDef('src\bin\pgevent\pgevent.def');
+       $pgevent->RemoveFile('src/bin/pgevent/win32ver.rc');
+       $pgevent->UseDef('src/bin/pgevent/pgevent.def');
        $pgevent->DisableLinkerWarnings('4104');
 
        my $pgdump = AddSimpleFrontend('pg_dump', 1);
-       $pgdump->AddIncludeDir('src\backend');
-       $pgdump->AddFile('src\bin\pg_dump\pg_dump.c');
-       $pgdump->AddFile('src\bin\pg_dump\common.c');
-       $pgdump->AddFile('src\bin\pg_dump\pg_dump_sort.c');
-       $pgdump->AddFile('src\bin\pg_dump\keywords.c');
-       $pgdump->AddFile('src\backend\parser\kwlookup.c');
+       $pgdump->AddIncludeDir('src/backend');
+       $pgdump->AddFile('src/bin/pg_dump/pg_dump.c');
+       $pgdump->AddFile('src/bin/pg_dump/common.c');
+       $pgdump->AddFile('src/bin/pg_dump/pg_dump_sort.c');
+       $pgdump->AddFile('src/bin/pg_dump/keywords.c');
+       $pgdump->AddFile('src/backend/parser/kwlookup.c');
        $pgdump->AddLibrary('ws2_32.lib');
 
        my $pgdumpall = AddSimpleFrontend('pg_dump', 1);
@@ -463,41 +465,41 @@ sub mkvcbuild
        # pg_dump and pg_restore.
        # So remove their sources from the object, keeping the other setup that
        # AddSimpleFrontend() has done.
-       my @nodumpall = grep { m/src\\bin\\pg_dump\\.*\.c$/ }
+       my @nodumpall = grep { m!src/bin/pg_dump/.*\.c$! }
          keys %{ $pgdumpall->{files} };
        delete @{ $pgdumpall->{files} }{@nodumpall};
        $pgdumpall->{name} = 'pg_dumpall';
-       $pgdumpall->AddIncludeDir('src\backend');
-       $pgdumpall->AddFile('src\bin\pg_dump\pg_dumpall.c');
-       $pgdumpall->AddFile('src\bin\pg_dump\dumputils.c');
-       $pgdumpall->AddFile('src\bin\pg_dump\keywords.c');
-       $pgdumpall->AddFile('src\backend\parser\kwlookup.c');
+       $pgdumpall->AddIncludeDir('src/backend');
+       $pgdumpall->AddFile('src/bin/pg_dump/pg_dumpall.c');
+       $pgdumpall->AddFile('src/bin/pg_dump/dumputils.c');
+       $pgdumpall->AddFile('src/bin/pg_dump/keywords.c');
+       $pgdumpall->AddFile('src/backend/parser/kwlookup.c');
        $pgdumpall->AddLibrary('ws2_32.lib');
 
        my $pgrestore = AddSimpleFrontend('pg_dump', 1);
        $pgrestore->{name} = 'pg_restore';
-       $pgrestore->AddIncludeDir('src\backend');
-       $pgrestore->AddFile('src\bin\pg_dump\pg_restore.c');
-       $pgrestore->AddFile('src\bin\pg_dump\keywords.c');
-       $pgrestore->AddFile('src\backend\parser\kwlookup.c');
+       $pgrestore->AddIncludeDir('src/backend');
+       $pgrestore->AddFile('src/bin/pg_dump/pg_restore.c');
+       $pgrestore->AddFile('src/bin/pg_dump/keywords.c');
+       $pgrestore->AddFile('src/backend/parser/kwlookup.c');
        $pgrestore->AddLibrary('ws2_32.lib');
 
        my $zic = $solution->AddProject('zic', 'exe', 'utils');
-       $zic->AddFiles('src\timezone', 'zic.c', 'ialloc.c', 'scheck.c',
+       $zic->AddFiles('src/timezone', 'zic.c', 'ialloc.c', 'scheck.c',
                'localtime.c');
-       $zic->AddDirResourceFile('src\timezone');
+       $zic->AddDirResourceFile('src/timezone');
        $zic->AddReference($libpgcommon, $libpgport);
 
        if ($solution->{options}->{xml})
        {
                $contrib_extraincludes->{'pgxml'} = [
-                       $solution->{options}->{xml} . '\include',
-                       $solution->{options}->{xslt} . '\include',
-                       $solution->{options}->{iconv} . '\include' ];
+                       $solution->{options}->{xml} . '/include',
+                       $solution->{options}->{xslt} . '/include',
+                       $solution->{options}->{iconv} . '/include' ];
 
                $contrib_extralibs->{'pgxml'} = [
-                       $solution->{options}->{xml} . '\lib\libxml2.lib',
-                       $solution->{options}->{xslt} . '\lib\libxslt.lib' ];
+                       $solution->{options}->{xml} . '/lib/libxml2.lib',
+                       $solution->{options}->{xslt} . '/lib/libxslt.lib' ];
        }
        else
        {
@@ -512,9 +514,9 @@ sub mkvcbuild
        if ($solution->{options}->{uuid})
        {
                $contrib_extraincludes->{'uuid-ossp'} =
-                 [ $solution->{options}->{uuid} . '\include' ];
+                 [ $solution->{options}->{uuid} . '/include' ];
                $contrib_extralibs->{'uuid-ossp'} =
-                 [ $solution->{options}->{uuid} . '\lib\uuid.lib' ];
+                 [ $solution->{options}->{uuid} . '/lib/uuid.lib' ];
        }
        else
        {
@@ -524,9 +526,9 @@ sub mkvcbuild
        # AddProject() does not recognize the constructs used to populate OBJS in
        # the pgcrypto Makefile, so it will discover no files.
        my $pgcrypto =
-         $solution->AddProject('pgcrypto', 'dll', 'crypto', 'contrib\\pgcrypto');
+         $solution->AddProject('pgcrypto', 'dll', 'crypto', 'contrib/pgcrypto');
        $pgcrypto->AddFiles(
-               'contrib\pgcrypto', 'pgcrypto.c',
+               'contrib/pgcrypto', 'pgcrypto.c',
                'px.c',             'px-hmac.c',
                'px-crypt.c',       'crypt-gensalt.c',
                'crypt-blowfish.c', 'crypt-des.c',
@@ -540,13 +542,13 @@ sub mkvcbuild
                'pgp-pgsql.c');
        if ($solution->{options}->{openssl})
        {
-               $pgcrypto->AddFiles('contrib\pgcrypto', 'openssl.c',
+               $pgcrypto->AddFiles('contrib/pgcrypto', 'openssl.c',
                        'pgp-mpi-openssl.c');
        }
        else
        {
                $pgcrypto->AddFiles(
-                       'contrib\pgcrypto',   'md5.c',
+                       'contrib/pgcrypto',   'md5.c',
                        'sha1.c',             'sha2.c',
                        'internal.c',         'internal-sha2.c',
                        'blf.c',              'rijndael.c',
@@ -572,22 +574,22 @@ sub mkvcbuild
        }
 
        $mf =
-         Project::read_file('src\backend\utils\mb\conversion_procs\Makefile');
+         Project::read_file('src/backend/utils/mb/conversion_procs/Makefile');
        $mf =~ s{\\\r?\n}{}g;
        $mf =~ m{SUBDIRS\s*=\s*(.*)$}m
          || die 'Could not match in conversion makefile' . "\n";
        foreach my $sub (split /\s+/, $1)
        {
-               my $dir = 'src\backend\utils\mb\conversion_procs\\' . $sub;
+               my $dir = 'src/backend/utils/mb/conversion_procs/' . $sub;
                my $p = $solution->AddProject($sub, 'dll', 'conversion procs', $dir);
-               $p->AddFile("$dir\\$sub.c");    # implicit source file
+               $p->AddFile("$dir/$sub.c");    # implicit source file
                $p->AddReference($postgres);
        }
 
-       $mf = Project::read_file('src\bin\scripts\Makefile');
+       $mf = Project::read_file('src/bin/scripts/Makefile');
        $mf =~ s{\\\r?\n}{}g;
        $mf =~ m{PROGRAMS\s*=\s*(.*)$}m
-         || die 'Could not match in bin\scripts\Makefile' . "\n";
+         || die 'Could not match in bin/scripts/Makefile' . "\n";
        foreach my $prg (split /\s+/, $1)
        {
                my $proj = $solution->AddProject($prg, 'exe', 'bin');
@@ -599,57 +601,57 @@ sub mkvcbuild
                        $f =~ s/\.o$/\.c/;
                        if ($f eq 'keywords.c')
                        {
-                               $proj->AddFile('src\bin\pg_dump\keywords.c');
+                               $proj->AddFile('src/bin/pg_dump/keywords.c');
                        }
                        elsif ($f eq 'kwlookup.c')
                        {
-                               $proj->AddFile('src\backend\parser\kwlookup.c');
+                               $proj->AddFile('src/backend/parser/kwlookup.c');
                        }
                        elsif ($f eq 'dumputils.c')
                        {
-                               $proj->AddFile('src\bin\pg_dump\dumputils.c');
+                               $proj->AddFile('src/bin/pg_dump/dumputils.c');
                        }
                        elsif ($f =~ /print\.c$/)
                        {    # Also catches mbprint.c
-                               $proj->AddFile('src\bin\psql\\' . $f);
+                               $proj->AddFile('src/bin/psql/' . $f);
                        }
                        elsif ($f =~ /\.c$/)
                        {
-                               $proj->AddFile('src\bin\scripts\\' . $f);
+                               $proj->AddFile('src/bin/scripts/' . $f);
                        }
                }
-               $proj->AddIncludeDir('src\interfaces\libpq');
-               $proj->AddIncludeDir('src\bin\pg_dump');
-               $proj->AddIncludeDir('src\bin\psql');
+               $proj->AddIncludeDir('src/interfaces/libpq');
+               $proj->AddIncludeDir('src/bin/pg_dump');
+               $proj->AddIncludeDir('src/bin/psql');
                $proj->AddReference($libpq, $libpgcommon, $libpgport);
-               $proj->AddDirResourceFile('src\bin\scripts');
+               $proj->AddDirResourceFile('src/bin/scripts');
                $proj->AddLibrary('ws2_32.lib');
        }
 
        # Regression DLL and EXE
        my $regress = $solution->AddProject('regress', 'dll', 'misc');
-       $regress->AddFile('src\test\regress\regress.c');
-       $regress->AddDirResourceFile('src\test\regress');
+       $regress->AddFile('src/test/regress/regress.c');
+       $regress->AddDirResourceFile('src/test/regress');
        $regress->AddReference($postgres);
 
        my $pgregress = $solution->AddProject('pg_regress', 'exe', 'misc');
-       $pgregress->AddFile('src\test\regress\pg_regress.c');
-       $pgregress->AddFile('src\test\regress\pg_regress_main.c');
-       $pgregress->AddIncludeDir('src\port');
+       $pgregress->AddFile('src/test/regress/pg_regress.c');
+       $pgregress->AddFile('src/test/regress/pg_regress_main.c');
+       $pgregress->AddIncludeDir('src/port');
        $pgregress->AddDefine('HOST_TUPLE="i686-pc-win32vc"');
        $pgregress->AddLibrary('ws2_32.lib');
-       $pgregress->AddDirResourceFile('src\test\regress');
+       $pgregress->AddDirResourceFile('src/test/regress');
        $pgregress->AddReference($libpgcommon, $libpgport);
 
        # fix up pg_xlogdump once it's been set up
        # files symlinked on Unix are copied on windows
        my $pg_xlogdump = AddSimpleFrontend('pg_xlogdump');
        $pg_xlogdump->AddDefine('FRONTEND');
-       foreach my $xf (glob('src\\backend\\access\\rmgrdesc\\*desc.c'))
+       foreach my $xf (glob('src/backend/access/rmgrdesc/*desc.c'))
        {
                $pg_xlogdump->AddFile($xf)
        }
-       $pg_xlogdump->AddFile('src\backend\access\transam\xlogreader.c');
+       $pg_xlogdump->AddFile('src/backend/access/transam/xlogreader.c');
 
        $solution->Save();
        return $solution->{vcver};
@@ -666,11 +668,11 @@ sub AddSimpleFrontend
        my $uselibpq = shift;
 
        my $p = $solution->AddProject($n, 'exe', 'bin');
-       $p->AddDir('src\bin\\' . $n);
+       $p->AddDir('src/bin/' . $n);
        $p->AddReference($libpgcommon, $libpgport);
        if ($uselibpq)
        {
-               $p->AddIncludeDir('src\interfaces\libpq');
+               $p->AddIncludeDir('src/interfaces/libpq');
                $p->AddReference($libpq);
        }
 
@@ -702,7 +704,7 @@ sub AddContrib
                        my $proj =
                          $solution->AddProject($mod, 'dll', 'contrib', "$subdir/$n");
                        my $filename = $mod . '.c';
-                       $proj->AddFile($subdir . '\\' . $n . '\\' .  $mod . '.c');
+                       $proj->AddFile("$subdir/$n/$filename");
                        $proj->AddReference($postgres);
                        AdjustContribProj($proj);
                }
index b9b5a239d8af82eb2566ce239e9f302eeed59ff3..362beb4218afb28e6c7d9de882fe76be2f3ec2ee 100644 (file)
@@ -52,20 +52,19 @@ sub AddFiles
 
        while (my $f = shift)
        {
-               $self->{files}->{ $dir . "\\" . $f } = 1;
+               $self->{files}->{ $dir . "/" . $f } = 1;
        }
 }
 
 sub ReplaceFile
 {
        my ($self, $filename, $newname) = @_;
-       my $re = "\\\\$filename\$";
+       my $re = "\\/$filename\$";
 
        foreach my $file (keys %{ $self->{files} })
        {
-
                # Match complete filename
-               if ($filename =~ /\\/)
+               if ($filename =~ m!/!)
                {
                        if ($file eq $filename)
                        {
@@ -77,7 +76,7 @@ sub ReplaceFile
                elsif ($file =~ m/($re)/)
                {
                        delete $self->{files}{$file};
-                       $self->{files}{"$newname\\$filename"} = 1;
+                       $self->{files}{"$newname/$filename"} = 1;
                        return;
                }
        }
@@ -105,7 +104,7 @@ sub RelocateFiles
                if ($r)
                {
                        $self->RemoveFile($f);
-                       $self->AddFile($targetdir . '\\' . basename($f));
+                       $self->AddFile($targetdir . '/' . basename($f));
                }
        }
 }
@@ -118,7 +117,7 @@ sub AddReference
        {
                push @{ $self->{references} }, $ref;
                $self->AddLibrary(
-                       "__CFGNAME__\\" . $ref->{name} . "\\" . $ref->{name} . ".lib");
+                       "__CFGNAME__/" . $ref->{name} . "/" . $ref->{name} . ".lib");
        }
 }
 
@@ -169,8 +168,8 @@ sub FullExportDLL
        my ($self, $libname) = @_;
 
        $self->{builddef} = 1;
-       $self->{def}      = ".\\__CFGNAME__\\$self->{name}\\$self->{name}.def";
-       $self->{implib}   = "__CFGNAME__\\$self->{name}\\$libname";
+       $self->{def}      = "./__CFGNAME__/$self->{name}/$self->{name}.def";
+       $self->{implib}   = "__CFGNAME__/$self->{name}/$libname";
 }
 
 sub UseDef
@@ -194,9 +193,9 @@ sub AddDir
                          if $subdir eq "\$(top_builddir)/src/timezone"
                        ;    #special case for non-standard include
                        next
-                         if $reldir . "\\" . $subdir eq "src\\backend\\port\\darwin";
+                         if $reldir . "/" . $subdir eq "src/backend/port/darwin";
 
-                       $self->AddDir($reldir . "\\" . $subdir);
+                       $self->AddDir($reldir . "/" . $subdir);
                }
        }
        while ($mf =~ m{^(?:EXTRA_)?OBJS[^=]*=\s*(.*)$}m)
@@ -243,13 +242,11 @@ sub AddDir
                        if ($f =~ /^\$\(top_builddir\)\/(.*)/)
                        {
                                $f = $1;
-                               $f =~ s/\//\\/g;
                                $self->{files}->{$f} = 1;
                        }
                        else
                        {
-                               $f =~ s/\//\\/g;
-                               $self->{files}->{"$reldir\\$f"} = 1;
+                               $self->{files}->{"$reldir/$f"} = 1;
                        }
                }
                $mf =~ s{OBJS[^=]*=\s*(.*)$}{}m;
@@ -264,7 +261,6 @@ sub AddDir
                my $match  = $1;
                my $top    = $2;
                my $target = $3;
-               $target =~ s{/}{\\}g;
                my @pieces = split /\s+/, $match;
                foreach my $fn (@pieces)
                {
@@ -274,7 +270,7 @@ sub AddDir
                        }
                        elsif ($top eq "(backend_src)")
                        {
-                               eval { $self->ReplaceFile($fn, "src\\backend\\$target") };
+                               eval { $self->ReplaceFile($fn, "src/backend/$target") };
                        }
                        else
                        {
@@ -310,12 +306,12 @@ sub AddResourceFile
          localtime(time);
        my $d = sprintf("%02d%03d", ($year - 100), $yday);
 
-       if (Solution::IsNewer("$dir\\win32ver.rc", 'src\port\win32ver.rc'))
+       if (Solution::IsNewer("$dir/win32ver.rc", 'src/port/win32ver.rc'))
        {
                print "Generating win32ver.rc for $dir\n";
-               open(I, 'src\port\win32ver.rc')
+               open(I, 'src/port/win32ver.rc')
                  || confess "Could not open win32ver.rc";
-               open(O, ">$dir\\win32ver.rc")
+               open(O, ">$dir/win32ver.rc")
                  || confess "Could not write win32ver.rc";
                my $icostr = $ico ? "IDI_ICON ICON \"src/port/$ico.ico\"" : "";
                while (<I>)
@@ -332,7 +328,7 @@ sub AddResourceFile
        }
        close(O);
        close(I);
-       $self->AddFile("$dir\\win32ver.rc");
+       $self->AddFile("$dir/win32ver.rc");
 }
 
 sub DisableLinkerWarnings
@@ -415,9 +411,9 @@ sub read_makefile
        my $t = $/;
 
        undef $/;
-       open($F, "$reldir\\GNUmakefile")
-         || open($F, "$reldir\\Makefile")
-         || croak "Could not open $reldir\\Makefile\n";
+       open($F, "$reldir/GNUmakefile")
+         || open($F, "$reldir/Makefile")
+         || confess "Could not open $reldir/Makefile\n";
        my $txt = <$F>;
        close($F);
        $/ = $t;
index 764ba1e6923b071d9f694f2dde261498bd21237a..db95afa14ba900d8f49a95b3551d25de7ba4220b 100644 (file)
@@ -87,15 +87,15 @@ sub DeterminePlatform
 sub IsNewer
 {
        my ($newfile, $oldfile) = @_;
-       if (   $oldfile ne 'src\tools\msvc\config.pl'
-               && $oldfile ne 'src\tools\msvc\config_default.pl')
+       if (   $oldfile ne 'src/tools/msvc/config.pl'
+               && $oldfile ne 'src/tools/msvc/config_default.pl')
        {
                return 1
-                 if (-f 'src\tools\msvc\config.pl')
-                 && IsNewer($newfile, 'src\tools\msvc\config.pl');
+                 if (-f 'src/tools/msvc/config.pl')
+                 && IsNewer($newfile, 'src/tools/msvc/config.pl');
                return 1
-                 if (-f 'src\tools\msvc\config_default.pl')
-                 && IsNewer($newfile, 'src\tools\msvc\config_default.pl');
+                 if (-f 'src/tools/msvc/config_default.pl')
+                 && IsNewer($newfile, 'src/tools/msvc/config_default.pl');
        }
        return 1 if (!(-e $newfile));
        my @nstat = stat($newfile);
@@ -144,20 +144,20 @@ sub GenerateFiles
          if ($self->{strver} eq '' || $self->{numver} eq '');
 
        if (IsNewer(
-                       "src\\include\\pg_config_os.h", "src\\include\\port\\win32.h"))
+                       "src/include/pg_config_os.h", "src/include/port/win32.h"))
        {
                print "Copying pg_config_os.h...\n";
-               copyFile("src\\include\\port\\win32.h",
-                       "src\\include\\pg_config_os.h");
+               copyFile("src/include/port/win32.h",
+                       "src/include/pg_config_os.h");
        }
 
        if (IsNewer(
-                       "src\\include\\pg_config.h", "src\\include\\pg_config.h.win32"))
+                       "src/include/pg_config.h", "src/include/pg_config.h.win32"))
        {
                print "Generating pg_config.h...\n";
-               open(I, "src\\include\\pg_config.h.win32")
+               open(I, "src/include/pg_config.h.win32")
                  || confess "Could not open pg_config.h.win32\n";
-               open(O, ">src\\include\\pg_config.h")
+               open(O, ">src/include/pg_config.h")
                  || confess "Could not write to pg_config.h\n";
                my $extraver = $self->{options}->{extraver};
                $extraver = '' unless defined $extraver;
@@ -245,111 +245,111 @@ sub GenerateFiles
        }
 
        if (IsNewer(
-                       "src\\include\\pg_config_ext.h",
-                       "src\\include\\pg_config_ext.h.win32"))
+                       "src/include/pg_config_ext.h",
+                       "src/include/pg_config_ext.h.win32"))
        {
                print "Copying pg_config_ext.h...\n";
                copyFile(
-                       "src\\include\\pg_config_ext.h.win32",
-                       "src\\include\\pg_config_ext.h");
+                       "src/include/pg_config_ext.h.win32",
+                       "src/include/pg_config_ext.h");
        }
 
        $self->GenerateDefFile(
-               "src\\interfaces\\libpq\\libpqdll.def",
-               "src\\interfaces\\libpq\\exports.txt",
+               "src/interfaces/libpq/libpqdll.def",
+               "src/interfaces/libpq/exports.txt",
                "LIBPQ");
        $self->GenerateDefFile(
-               "src\\interfaces\\ecpg\\ecpglib\\ecpglib.def",
-               "src\\interfaces\\ecpg\\ecpglib\\exports.txt",
+               "src/interfaces/ecpg/ecpglib/ecpglib.def",
+               "src/interfaces/ecpg/ecpglib/exports.txt",
                "LIBECPG");
        $self->GenerateDefFile(
-               "src\\interfaces\\ecpg\\compatlib\\compatlib.def",
-               "src\\interfaces\\ecpg\\compatlib\\exports.txt",
+               "src/interfaces/ecpg/compatlib/compatlib.def",
+               "src/interfaces/ecpg/compatlib/exports.txt",
                "LIBECPG_COMPAT");
        $self->GenerateDefFile(
-               "src\\interfaces\\ecpg\\pgtypeslib\\pgtypeslib.def",
-               "src\\interfaces\\ecpg\\pgtypeslib\\exports.txt",
+               "src/interfaces/ecpg/pgtypeslib/pgtypeslib.def",
+               "src/interfaces/ecpg/pgtypeslib/exports.txt",
                "LIBPGTYPES");
 
        if (IsNewer(
-                       'src\backend\utils\fmgrtab.c', 'src\include\catalog\pg_proc.h'))
+                       'src/backend/utils/fmgrtab.c', 'src/include/catalog/pg_proc.h'))
        {
                print "Generating fmgrtab.c and fmgroids.h...\n";
-               chdir('src\backend\utils');
+               chdir('src/backend/utils');
                system(
 "perl -I ../catalog Gen_fmgrtab.pl ../../../src/include/catalog/pg_proc.h");
-               chdir('..\..\..');
+               chdir('../../..');
        }
        if (IsNewer(
-                       'src\include\utils\fmgroids.h',
-                       'src\backend\utils\fmgroids.h'))
+                       'src/include/utils/fmgroids.h',
+                       'src/backend/utils/fmgroids.h'))
        {
-               copyFile('src\backend\utils\fmgroids.h',
-                       'src\include\utils\fmgroids.h');
+               copyFile('src/backend/utils/fmgroids.h',
+                       'src/include/utils/fmgroids.h');
        }
 
-       if (IsNewer('src\include\utils\probes.h', 'src\backend\utils\probes.d'))
+       if (IsNewer('src/include/utils/probes.h', 'src/backend/utils/probes.d'))
        {
                print "Generating probes.h...\n";
                system(
-'psed -f src\backend\utils\Gen_dummy_probes.sed src\backend\utils\probes.d > src\include\utils\probes.h'
+'psed -f src/backend/utils/Gen_dummy_probes.sed src/backend/utils/probes.d > src/include/utils/probes.h'
                );
        }
 
        if ($self->{options}->{python}
                && IsNewer(
-                       'src\pl\plpython\spiexceptions.h',
-                       'src\include\backend\errcodes.txt'))
+                       'src/pl/plpython/spiexceptions.h',
+                       'src/include/backend/errcodes.txt'))
        {
                print "Generating spiexceptions.h...\n";
                system(
-'perl src\pl\plpython\generate-spiexceptions.pl src\backend\utils\errcodes.txt > src\pl\plpython\spiexceptions.h'
+'perl src/pl/plpython/generate-spiexceptions.pl src/backend/utils/errcodes.txt > src/pl/plpython/spiexceptions.h'
                );
        }
 
        if (IsNewer(
-                       'src\include\utils\errcodes.h',
-                       'src\backend\utils\errcodes.txt'))
+                       'src/include/utils/errcodes.h',
+                       'src/backend/utils/errcodes.txt'))
        {
                print "Generating errcodes.h...\n";
                system(
-'perl src\backend\utils\generate-errcodes.pl src\backend\utils\errcodes.txt > src\backend\utils\errcodes.h'
+'perl src/backend/utils/generate-errcodes.pl src/backend/utils/errcodes.txt > src/backend/utils/errcodes.h'
                );
-               copyFile('src\backend\utils\errcodes.h',
-                       'src\include\utils\errcodes.h');
+               copyFile('src/backend/utils/errcodes.h',
+                       'src/include/utils/errcodes.h');
        }
 
        if (IsNewer(
-                       'src\pl\plpgsql\src\plerrcodes.h',
-                       'src\backend\utils\errcodes.txt'))
+                       'src/pl/plpgsql/src/plerrcodes.h',
+                       'src/backend/utils/errcodes.txt'))
        {
                print "Generating plerrcodes.h...\n";
                system(
-'perl src\pl\plpgsql\src\generate-plerrcodes.pl src\backend\utils\errcodes.txt > src\pl\plpgsql\src\plerrcodes.h'
+'perl src/pl/plpgsql/src/generate-plerrcodes.pl src/backend/utils/errcodes.txt > src/pl/plpgsql/src/plerrcodes.h'
                );
        }
 
        if (IsNewer(
-                       'src\backend\utils\sort\qsort_tuple.c',
-                       'src\backend\utils\sort\gen_qsort_tuple.pl'))
+                       'src/backend/utils/sort/qsort_tuple.c',
+                       'src/backend/utils/sort/gen_qsort_tuple.pl'))
        {
                print "Generating qsort_tuple.c...\n";
                system(
-'perl src\backend\utils\sort\gen_qsort_tuple.pl > src\backend\utils\sort\qsort_tuple.c'
+'perl src/backend/utils/sort/gen_qsort_tuple.pl > src/backend/utils/sort/qsort_tuple.c'
                );
        }
 
        if (IsNewer(
-                       'src\interfaces\libpq\libpq.rc',
-                       'src\interfaces\libpq\libpq.rc.in'))
+                       'src/interfaces/libpq/libpq.rc',
+                       'src/interfaces/libpq/libpq.rc.in'))
        {
                print "Generating libpq.rc...\n";
                my ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) =
                  localtime(time);
                my $d = ($year - 100) . "$yday";
-               open(I, '<', 'src\interfaces\libpq\libpq.rc.in')
+               open(I, '<', 'src/interfaces/libpq/libpq.rc.in')
                  || confess "Could not open libpq.rc.in";
-               open(O, '>', 'src\interfaces\libpq\libpq.rc')
+               open(O, '>', 'src/interfaces/libpq/libpq.rc')
                  || confess "Could not open libpq.rc";
                while (<I>)
                {
@@ -360,30 +360,30 @@ sub GenerateFiles
                close(O);
        }
 
-       if (IsNewer('src\bin\psql\sql_help.h', 'src\bin\psql\create_help.pl'))
+       if (IsNewer('src/bin/psql/sql_help.h', 'src/bin/psql/create_help.pl'))
        {
                print "Generating sql_help.h...\n";
-               chdir('src\bin\psql');
+               chdir('src/bin/psql');
                system("perl create_help.pl ../../../doc/src/sgml/ref sql_help");
-               chdir('..\..\..');
+               chdir('../../..');
        }
 
        if (IsNewer(
-                       'src\interfaces\ecpg\preproc\preproc.y',
-                       'src\backend\parser\gram.y'))
+                       'src/interfaces/ecpg/preproc/preproc.y',
+                       'src/backend/parser/gram.y'))
        {
                print "Generating preproc.y...\n";
-               chdir('src\interfaces\ecpg\preproc');
-               system('perl parse.pl < ..\..\..\backend\parser\gram.y > preproc.y');
-               chdir('..\..\..\..');
+               chdir('src/interfaces/ecpg/preproc');
+               system('perl parse.pl < ../../../backend/parser/gram.y > preproc.y');
+               chdir('../../../..');
        }
 
        if (IsNewer(
-                       'src\interfaces\ecpg\include\ecpg_config.h',
-                       'src\interfaces\ecpg\include\ecpg_config.h.in'))
+                       'src/interfaces/ecpg/include/ecpg_config.h',
+                       'src/interfaces/ecpg/include/ecpg_config.h.in'))
        {
                print "Generating ecpg_config.h...\n";
-               open(O, '>', 'src\interfaces\ecpg\include\ecpg_config.h')
+               open(O, '>', 'src/interfaces/ecpg/include/ecpg_config.h')
                  || confess "Could not open ecpg_config.h";
                print O <<EOF;
 #if (_MSC_VER > 1200)
@@ -396,10 +396,10 @@ EOF
                close(O);
        }
 
-       unless (-f "src\\port\\pg_config_paths.h")
+       unless (-f "src/port/pg_config_paths.h")
        {
                print "Generating pg_config_paths.h...\n";
-               open(O, '>', 'src\port\pg_config_paths.h')
+               open(O, '>', 'src/port/pg_config_paths.h')
                  || confess "Could not open pg_config_paths.h";
                print O <<EOF;
 #define PGBINDIR "/bin"
@@ -418,7 +418,7 @@ EOF
                close(O);
        }
 
-       my $mf = Project::read_file('src\backend\catalog\Makefile');
+       my $mf = Project::read_file('src/backend/catalog/Makefile');
        $mf =~ s{\\\r?\n}{}g;
        $mf =~ /^POSTGRES_BKI_SRCS\s*:?=[^,]+,(.*)\)$/gm
          || croak "Could not find POSTGRES_BKI_SRCS in Makefile\n";
@@ -431,15 +431,15 @@ EOF
                                "src/include/catalog/$bki"))
                {
                        print "Generating postgres.bki and schemapg.h...\n";
-                       chdir('src\backend\catalog');
+                       chdir('src/backend/catalog');
                        my $bki_srcs = join(' ../../../src/include/catalog/', @allbki);
                        system(
 "perl genbki.pl -I../../../src/include/catalog --set-version=$self->{majorver} $bki_srcs"
                        );
-                       chdir('..\..\..');
+                       chdir('../../..');
                        copyFile(
-                               'src\backend\catalog\schemapg.h',
-                               'src\include\catalog\schemapg.h');
+                               'src/backend/catalog/schemapg.h',
+                               'src/include/catalog/schemapg.h');
                        last;
                }
        }