Skip to content

Commit 477c5d3

Browse files
committed
Install .mo files for NLS as <program>-<version>.mo when building with MSVC
as well. Same change as made earlier for autoconf builds. Per Hiroshi Inoue.
1 parent b2a667b commit 477c5d3

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

src/tools/msvc/Install.pm

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package Install;
33
#
44
# Package that provides 'make install' functionality for msvc builds
55
#
6-
# $PostgreSQL: pgsql/src/tools/msvc/Install.pm,v 1.31 2008/09/17 04:31:08 tgl Exp $
6+
# $PostgreSQL: pgsql/src/tools/msvc/Install.pm,v 1.32 2009/01/21 09:25:11 mha Exp $
77
#
88
use strict;
99
use warnings;
@@ -52,7 +52,8 @@ sub Install
5252
$conf = "release";
5353
}
5454
die "Could not find debug or release binaries" if ($conf eq "");
55-
print "Installing for $conf in $target\n";
55+
my $majorver = DetermineMajorVersion();
56+
print "Installing version $majorver for $conf in $target\n";
5657

5758
EnsureDirectories($target, 'bin','lib','share','share/timezonesets','share/contrib','doc',
5859
'doc/contrib', 'symbols', 'share/tsearch_data');
@@ -101,7 +102,7 @@ sub Install
101102
CopyContribFiles($config,$target);
102103
CopyIncludeFiles($target);
103104

104-
GenerateNLSFiles($target,$config->{nls}) if ($config->{nls});
105+
GenerateNLSFiles($target,$config->{nls},$majorver) if ($config->{nls});
105106

106107
print "Installation complete.\n";
107108
}
@@ -457,6 +458,7 @@ sub GenerateNLSFiles
457458
{
458459
my $target = shift;
459460
my $nlspath = shift;
461+
my $majorver = shift;
460462

461463
print "Installing NLS files...";
462464
EnsureDirectories($target, "share/locale");
@@ -481,7 +483,7 @@ sub GenerateNLSFiles
481483

482484
EnsureDirectories($target, "share/locale/$lang", "share/locale/$lang/LC_MESSAGES");
483485
system(
484-
"\"$nlspath\\bin\\msgfmt\" -o \"$target\\share\\locale\\$lang\\LC_MESSAGES\\$prgm.mo\" $_"
486+
"\"$nlspath\\bin\\msgfmt\" -o \"$target\\share\\locale\\$lang\\LC_MESSAGES\\$prgm-$majorver.mo\" $_"
485487
)
486488
&& croak("Could not run msgfmt on $dir\\$_");
487489
print ".";
@@ -490,6 +492,13 @@ sub GenerateNLSFiles
490492
print "\n";
491493
}
492494

495+
sub DetermineMajorVersion
496+
{
497+
my $f = read_file('src/include/pg_config.h') || croak 'Could not open pg_config.h';
498+
$f =~ /^#define\s+PG_MAJORVERSION\s+"([^"]+)"/m || croak 'Could not determine major version';
499+
return $1;
500+
}
501+
493502
sub read_file
494503
{
495504
my $filename = shift;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy