@@ -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.16 2007/06/12 11:07:34 mha Exp $
6+ # $PostgreSQL: pgsql/src/tools/msvc/Install.pm,v 1.17 2007/08/27 10:29:49 mha Exp $
77#
88use strict;
99use warnings;
@@ -64,6 +64,7 @@ sub Install
6464 );
6565 GenerateConversionScript($target );
6666 GenerateTimezoneFiles($target ,$conf );
67+ GenerateTsearchFiles($target );
6768 CopyContribFiles($config ,$target );
6869 CopyIncludeFiles($target );
6970
@@ -216,6 +217,45 @@ sub GenerateTimezoneFiles
216217print " \n " ;
217218}
218219
220+ sub GenerateTsearchFiles
221+ {
222+ my $target =shift ;
223+
224+ print " Generating tsearch script..." ;
225+ my $F ;
226+ my $tmpl = read_file(' src/backend/snowball/snowball.sql.in' );
227+ my $mf = read_file(' src/backend/snowball/Makefile' );
228+ $mf =~s {\\\s *[\r\n ]+} {} mg ;
229+ $mf =~/ ^LANGUAGES\s *=\s *(.*)$ /m
230+ ||die " Could not find LANGUAGES line in snowball Makefile\n " ;
231+ my @pieces =split /\s +/,$1 ;
232+ open ($F ," >$target /share/snowball_create.sql" )
233+ ||die " Could not write snowball_create.sql" ;
234+ print $F read_file(' src/backend/snowball/snowball_func.sql.in' );
235+ while ($#pieces > 0)
236+ {
237+ my $lang =shift @pieces ||last ;
238+ my $latlang =shift @pieces ||last ;
239+ my $txt =$tmpl ;
240+ my $stop =' ' ;
241+
242+ if (-s " src/backend/snowball/stopwords/$lang .stop" ) {
243+ $stop =" , StopWords=$lang " ;
244+ }
245+
246+ $txt =~s # _LANGNAME_# ${lang} # gs ;
247+ $txt =~s # _DICTNAME_# ${lang} _stem# gs ;
248+ $txt =~s # _CFGNAME_# ${lang} # gs ;
249+ $txt =~s # _LATDICTNAME_# ${latlang} _stem# gs ;
250+ $txt =~s # _NONLATDICTNAME_# ${lang} _stem# gs ;
251+ $txt =~s # _STOPWORDS_# $stop # gs ;
252+ print $F $txt ;
253+ print " ." ;
254+ }
255+ close ($F );
256+ print " \n " ;
257+ }
258+
219259sub CopyContribFiles
220260{
221261my $config =shift ;