mirror of
https://github.com/postgres/postgres.git
synced 2025-04-22 23:02:54 +03:00
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.
This commit is contained in:
parent
b2a667b9ee
commit
477c5d3b0d
@ -3,7 +3,7 @@ package Install;
|
|||||||
#
|
#
|
||||||
# Package that provides 'make install' functionality for msvc builds
|
# Package that provides 'make install' functionality for msvc builds
|
||||||
#
|
#
|
||||||
# $PostgreSQL: pgsql/src/tools/msvc/Install.pm,v 1.31 2008/09/17 04:31:08 tgl Exp $
|
# $PostgreSQL: pgsql/src/tools/msvc/Install.pm,v 1.32 2009/01/21 09:25:11 mha Exp $
|
||||||
#
|
#
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
@ -52,7 +52,8 @@ sub Install
|
|||||||
$conf = "release";
|
$conf = "release";
|
||||||
}
|
}
|
||||||
die "Could not find debug or release binaries" if ($conf eq "");
|
die "Could not find debug or release binaries" if ($conf eq "");
|
||||||
print "Installing for $conf in $target\n";
|
my $majorver = DetermineMajorVersion();
|
||||||
|
print "Installing version $majorver for $conf in $target\n";
|
||||||
|
|
||||||
EnsureDirectories($target, 'bin','lib','share','share/timezonesets','share/contrib','doc',
|
EnsureDirectories($target, 'bin','lib','share','share/timezonesets','share/contrib','doc',
|
||||||
'doc/contrib', 'symbols', 'share/tsearch_data');
|
'doc/contrib', 'symbols', 'share/tsearch_data');
|
||||||
@ -101,7 +102,7 @@ sub Install
|
|||||||
CopyContribFiles($config,$target);
|
CopyContribFiles($config,$target);
|
||||||
CopyIncludeFiles($target);
|
CopyIncludeFiles($target);
|
||||||
|
|
||||||
GenerateNLSFiles($target,$config->{nls}) if ($config->{nls});
|
GenerateNLSFiles($target,$config->{nls},$majorver) if ($config->{nls});
|
||||||
|
|
||||||
print "Installation complete.\n";
|
print "Installation complete.\n";
|
||||||
}
|
}
|
||||||
@ -457,6 +458,7 @@ sub GenerateNLSFiles
|
|||||||
{
|
{
|
||||||
my $target = shift;
|
my $target = shift;
|
||||||
my $nlspath = shift;
|
my $nlspath = shift;
|
||||||
|
my $majorver = shift;
|
||||||
|
|
||||||
print "Installing NLS files...";
|
print "Installing NLS files...";
|
||||||
EnsureDirectories($target, "share/locale");
|
EnsureDirectories($target, "share/locale");
|
||||||
@ -481,7 +483,7 @@ sub GenerateNLSFiles
|
|||||||
|
|
||||||
EnsureDirectories($target, "share/locale/$lang", "share/locale/$lang/LC_MESSAGES");
|
EnsureDirectories($target, "share/locale/$lang", "share/locale/$lang/LC_MESSAGES");
|
||||||
system(
|
system(
|
||||||
"\"$nlspath\\bin\\msgfmt\" -o \"$target\\share\\locale\\$lang\\LC_MESSAGES\\$prgm.mo\" $_"
|
"\"$nlspath\\bin\\msgfmt\" -o \"$target\\share\\locale\\$lang\\LC_MESSAGES\\$prgm-$majorver.mo\" $_"
|
||||||
)
|
)
|
||||||
&& croak("Could not run msgfmt on $dir\\$_");
|
&& croak("Could not run msgfmt on $dir\\$_");
|
||||||
print ".";
|
print ".";
|
||||||
@ -490,6 +492,13 @@ sub GenerateNLSFiles
|
|||||||
print "\n";
|
print "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub DetermineMajorVersion
|
||||||
|
{
|
||||||
|
my $f = read_file('src/include/pg_config.h') || croak 'Could not open pg_config.h';
|
||||||
|
$f =~ /^#define\s+PG_MAJORVERSION\s+"([^"]+)"/m || croak 'Could not determine major version';
|
||||||
|
return $1;
|
||||||
|
}
|
||||||
|
|
||||||
sub read_file
|
sub read_file
|
||||||
{
|
{
|
||||||
my $filename = shift;
|
my $filename = shift;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user