Skip to content

Commit 8ca1571

Browse files
committed
Support for installing NLS files, and update support to use gettext
from gnuwin32.
1 parent 36d35a1 commit 8ca1571

File tree

3 files changed

+57
-4
lines changed

3 files changed

+57
-4
lines changed

doc/src/sgml/install-win32.sgml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- $PostgreSQL: pgsql/doc/src/sgml/install-win32.sgml,v 1.36 2007/03/23 09:57:55 mha Exp $ -->
1+
<!-- $PostgreSQL: pgsql/doc/src/sgml/install-win32.sgml,v 1.37 2007/03/24 22:16:49 mha Exp $ -->
22

33
<chapter id="install-win32">
44
<title>Installation on <productname>Windows</productname></title>
@@ -114,6 +114,15 @@
114114
</para></listitem>
115115
</varlistentry>
116116

117+
<varlistentry>
118+
<term><productname>Gettext</productname></term>
119+
<listitem><para>
120+
Gettext is required to build with NLS support, and can be downloaded
121+
from <ulink url="http://gnuwin32.sourceforge.net"></>. Note that binaries,
122+
dependencies and developer files are all needed.
123+
</para></listitem>
124+
</varlistentry>
125+
117126
<varlistentry>
118127
<term><productname>Microsoft Platform SDK</productname></term>
119128
<listitem><para>

src/tools/msvc/Install.pm

Lines changed: 45 additions & 1 deletion
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.3 2007/03/24 15:28:48 mha Exp $
6+
# $PostgreSQL: pgsql/src/tools/msvc/Install.pm,v 1.4 2007/03/24 22:16:49 mha Exp $
77
#
88
use strict;
99
use warnings;
@@ -21,6 +21,8 @@ sub Install
2121
$| = 1;
2222

2323
my $target = shift;
24+
our $config;
25+
require 'config.pl';
2426

2527
chdir("../../..") if (-f "../../../configure");
2628
my $conf = "";
@@ -57,6 +59,8 @@ sub Install
5759
GenerateConversionScript($target);
5860
GenerateTimezoneFiles($target,$conf);
5961
CopyContribFiles($target);
62+
63+
GenerateNLSFiles($target,$config->{nls}) if ($config->{nls});
6064
}
6165

6266
sub EnsureDirectories
@@ -274,6 +278,46 @@ sub ParseAndCleanRule
274278
return $flist;
275279
}
276280

281+
sub GenerateNLSFiles
282+
{
283+
my $target = shift;
284+
my $nlspath = shift;
285+
my $D;
286+
287+
print "Installing NLS files...";
288+
EnsureDirectories($target, "share/locale");
289+
open($D,"dir /b /s nls.mk|") || croak "Could not list nls.mk\n";
290+
while (<$D>)
291+
{
292+
chomp;
293+
s/nls.mk/po/;
294+
my $dir = $_;
295+
next unless ($dir =~ /([^\\]+)\\po$/);
296+
my $prgm = $1;
297+
$prgm = 'postgres' if ($prgm eq 'backend');
298+
my $E;
299+
open($E,"dir /b $dir\\*.po|") || croak "Could not list contents of $_\n";
300+
301+
while (<$E>)
302+
{
303+
chomp;
304+
my $lang;
305+
next unless /^(.*)\.po/;
306+
$lang = $1;
307+
308+
EnsureDirectories($target, "share/locale/$lang", "share/locale/$lang/LC_MESSAGES");
309+
system(
310+
"$nlspath\\bin\\msgfmt -o $target\\share\\locale\\$lang\\LC_MESSAGES\\$prgm.mo $dir\\$_"
311+
)
312+
&& croak("Could not run msgfmt on $dir\\$_");
313+
print ".";
314+
}
315+
close($E);
316+
}
317+
close($D);
318+
print "\n";
319+
}
320+
277321
sub read_file
278322
{
279323
my $filename = shift;

src/tools/msvc/Solution.pm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package Solution;
22
#
33
# Package that encapsulates a Visual C++ solution file generation
44
#
5-
# $PostgreSQL: pgsql/src/tools/msvc/Solution.pm,v 1.18 2007/03/23 08:43:51 mha Exp $
5+
# $PostgreSQL: pgsql/src/tools/msvc/Solution.pm,v 1.19 2007/03/24 22:16:49 mha Exp $
66
#
77
use Carp;
88
use strict;
@@ -313,7 +313,7 @@ sub AddProject
313313
if ($self->{options}->{nls})
314314
{
315315
$proj->AddIncludeDir($self->{options}->{nls} . '\include');
316-
$proj->AddLibrary($self->{options}->{nls} . '\lib\intl.lib');
316+
$proj->AddLibrary($self->{options}->{nls} . '\lib\libintl.lib');
317317
}
318318
if ($self->{options}->{krb5})
319319
{

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