Skip to content
Snippets Groups Projects
Select Git revision
  • benchmark-tools
  • postgres-lambda
  • master default
  • REL9_4_25
  • REL9_5_20
  • REL9_6_16
  • REL_10_11
  • REL_11_6
  • REL_12_1
  • REL_12_0
  • REL_12_RC1
  • REL_12_BETA4
  • REL9_4_24
  • REL9_5_19
  • REL9_6_15
  • REL_10_10
  • REL_11_5
  • REL_12_BETA3
  • REL9_4_23
  • REL9_5_18
  • REL9_6_14
  • REL_10_9
  • REL_11_4
23 results

Project.pm

Blame
    • Tom Lane's avatar
      5c02a00d
      Move CRC tables to libpgport, and provide them in a separate include file. · 5c02a00d
      Tom Lane authored
      This makes it much more convenient to build tools for Postgres that are
      separately compiled and require a matching CRC implementation.
      
      To prevent multiple copies of the CRC polynomial tables being introduced
      into the postgres binaries, they are now included in the static library
      libpgport that is mainly meant for replacement system functions.  That
      seems like a bit of a kludge, but there's no better place.
      
      This cleans up building of the tools pg_controldata and pg_resetxlog,
      which previously had to build their own copies of pg_crc.o.
      
      In the future, external programs that need access to the CRC tables can
      include the tables directly from the new header file pg_crc_tables.h.
      
      Daniel Farina, reviewed by Abhijit Menon-Sen and Tom Lane
      5c02a00d
      History
      Move CRC tables to libpgport, and provide them in a separate include file.
      Tom Lane authored
      This makes it much more convenient to build tools for Postgres that are
      separately compiled and require a matching CRC implementation.
      
      To prevent multiple copies of the CRC polynomial tables being introduced
      into the postgres binaries, they are now included in the static library
      libpgport that is mainly meant for replacement system functions.  That
      seems like a bit of a kludge, but there's no better place.
      
      This cleans up building of the tools pg_controldata and pg_resetxlog,
      which previously had to build their own copies of pg_crc.o.
      
      In the future, external programs that need access to the CRC tables can
      include the tables directly from the new header file pg_crc_tables.h.
      
      Daniel Farina, reviewed by Abhijit Menon-Sen and Tom Lane
    Project.pm 9.55 KiB
    package Project;
    
    #
    # Package that encapsulates a Visual C++ project file generation
    #
    # src/tools/msvc/Project.pm
    #
    use Carp;
    use strict;
    use warnings;
    use File::Basename;
    
    sub _new
    {
        my ($classname, $name, $type, $solution) = @_;
        my $good_types = {
            lib => 1,
            exe => 1,
            dll => 1,
        };
        confess("Bad project type: $type\n") unless exists $good_types->{$type};
        my $self = {
            name                  => $name,
            type                  => $type,
            guid                  => Win32::GuidGen(),
            files                 => {},
            references            => [],
            libraries             => [],
            suffixlib             => [],
            includes              => '',
            prefixincludes        => '',
            defines               => ';',
            solution              => $solution,
            disablewarnings       => '4018;4244;4273;4102;4090;4267',
            disablelinkerwarnings => '',
            platform              => $solution->{platform},
        };
    
        bless($self, $classname);
        return $self;
    }
    
    sub AddFile
    {
        my ($self, $filename) = @_;
    
        $self->{files}->{$filename} = 1;
    }
    
    sub AddFiles
    {
        my $self = shift;
        my $dir = shift;
    
        while (my $f = shift)
        {
            $self->{files}->{$dir . "\\" . $f} = 1;
        }
    }
    
    sub ReplaceFile
    {
        my ($self, $filename, $newname) = @_;
        my $re = "\\\\$filename\$";
    
        foreach my $file ( keys %{ $self->{files} } )
        {
    
            # Match complete filename
            if ($filename =~ /\\/)