diff --git a/doc/src/sgml/install-win32.sgml b/doc/src/sgml/install-win32.sgml index 8889496141..4244a0e6fb 100644 --- a/doc/src/sgml/install-win32.sgml +++ b/doc/src/sgml/install-win32.sgml @@ -1,4 +1,4 @@ - + Installation on <productname>Windows</productname> @@ -114,6 +114,15 @@ + + Gettext + + Gettext is required to build with NLS support, and can be downloaded + from . Note that binaries, + dependencies and developer files are all needed. + + + Microsoft Platform SDK diff --git a/src/tools/msvc/Install.pm b/src/tools/msvc/Install.pm index 707006ddd1..181ff6f40b 100644 --- a/src/tools/msvc/Install.pm +++ b/src/tools/msvc/Install.pm @@ -3,7 +3,7 @@ package Install; # # Package that provides 'make install' functionality for msvc builds # -# $PostgreSQL: pgsql/src/tools/msvc/Install.pm,v 1.3 2007/03/24 15:28:48 mha Exp $ +# $PostgreSQL: pgsql/src/tools/msvc/Install.pm,v 1.4 2007/03/24 22:16:49 mha Exp $ # use strict; use warnings; @@ -21,6 +21,8 @@ sub Install $| = 1; my $target = shift; + our $config; + require 'config.pl'; chdir("../../..") if (-f "../../../configure"); my $conf = ""; @@ -57,6 +59,8 @@ sub Install GenerateConversionScript($target); GenerateTimezoneFiles($target,$conf); CopyContribFiles($target); + + GenerateNLSFiles($target,$config->{nls}) if ($config->{nls}); } sub EnsureDirectories @@ -274,6 +278,46 @@ sub ParseAndCleanRule return $flist; } +sub GenerateNLSFiles +{ + my $target = shift; + my $nlspath = shift; + my $D; + + print "Installing NLS files..."; + EnsureDirectories($target, "share/locale"); + open($D,"dir /b /s nls.mk|") || croak "Could not list nls.mk\n"; + while (<$D>) + { + chomp; + s/nls.mk/po/; + my $dir = $_; + next unless ($dir =~ /([^\\]+)\\po$/); + my $prgm = $1; + $prgm = 'postgres' if ($prgm eq 'backend'); + my $E; + open($E,"dir /b $dir\\*.po|") || croak "Could not list contents of $_\n"; + + while (<$E>) + { + chomp; + my $lang; + next unless /^(.*)\.po/; + $lang = $1; + + EnsureDirectories($target, "share/locale/$lang", "share/locale/$lang/LC_MESSAGES"); + system( +"$nlspath\\bin\\msgfmt -o $target\\share\\locale\\$lang\\LC_MESSAGES\\$prgm.mo $dir\\$_" + ) + && croak("Could not run msgfmt on $dir\\$_"); + print "."; + } + close($E); + } + close($D); + print "\n"; +} + sub read_file { my $filename = shift; diff --git a/src/tools/msvc/Solution.pm b/src/tools/msvc/Solution.pm index d63d9e98b8..e665b49866 100644 --- a/src/tools/msvc/Solution.pm +++ b/src/tools/msvc/Solution.pm @@ -2,7 +2,7 @@ package Solution; # # Package that encapsulates a Visual C++ solution file generation # -# $PostgreSQL: pgsql/src/tools/msvc/Solution.pm,v 1.18 2007/03/23 08:43:51 mha Exp $ +# $PostgreSQL: pgsql/src/tools/msvc/Solution.pm,v 1.19 2007/03/24 22:16:49 mha Exp $ # use Carp; use strict; @@ -313,7 +313,7 @@ sub AddProject if ($self->{options}->{nls}) { $proj->AddIncludeDir($self->{options}->{nls} . '\include'); - $proj->AddLibrary($self->{options}->{nls} . '\lib\intl.lib'); + $proj->AddLibrary($self->{options}->{nls} . '\lib\libintl.lib'); } if ($self->{options}->{krb5}) {