@@ -3,7 +3,7 @@ package Install;
3
3
#
4
4
# Package that provides 'make install' functionality for msvc builds
5
5
#
6
- # $PostgreSQL: pgsql/src/tools/msvc/Install.pm,v 1.5 2007/03/27 21:47:10 mha Exp $
6
+ # $PostgreSQL: pgsql/src/tools/msvc/Install.pm,v 1.6 2007/03/29 20:48:26 mha Exp $
7
7
#
8
8
use strict;
9
9
use warnings;
@@ -44,9 +44,9 @@ sub Install
44
44
copy($target . ' /lib/libpq.dll' , $target . ' /bin/libpq.dll' );
45
45
CopySetOfFiles(' config files' , " *.sample" , $target . ' /share/' );
46
46
CopyFiles(
47
- ' Import libraries' , $target . ' /lib/ ' ,
48
- " $conf \\ " , " postgres \\ postgres. lib" ,
49
- " libpq\\ libpq.lib" , " libecpg\\ libecpg.lib"
47
+ ' Import libraries' ,
48
+ $target . ' / lib/ ' ,
49
+ " $conf \\ " , " postgres \\ postgres.lib " , " libpq\\ libpq.lib" , " libecpg\\ libecpg.lib"
50
50
);
51
51
CopySetOfFiles(' timezone names' , ' src\timezone\tznames\*.txt' ,$target . ' /share/timezonesets/' );
52
52
CopyFiles(
@@ -64,6 +64,7 @@ sub Install
64
64
GenerateConversionScript($target );
65
65
GenerateTimezoneFiles($target ,$conf );
66
66
CopyContribFiles($target );
67
+ CopyIncludeFiles($target );
67
68
68
69
GenerateNLSFiles($target ,$config -> {nls }) if ($config -> {nls });
69
70
}
@@ -101,17 +102,21 @@ sub CopySetOfFiles
101
102
my $what = shift ;
102
103
my $spec = shift ;
103
104
my $target = shift ;
105
+ my $silent = shift ;
106
+ my $norecurse = shift ;
104
107
my $D ;
105
108
106
- print " Copying $what " ;
107
- open ($D , " dir /b /s $spec |" ) || croak " Could not list $spec \n " ;
109
+ my $subdirs = $norecurse ?' ' :' /s' ;
110
+ print " Copying $what " unless ($silent );
111
+ open ($D , " dir /b $subdirs $spec |" ) || croak " Could not list $spec \n " ;
108
112
while (<$D >)
109
113
{
110
114
chomp ;
111
115
next if / regress/ ; # Skip temporary install in regression subdir
112
116
my $tgt = $target . basename($_ );
113
117
print " ." ;
114
- copy($_ , $tgt ) || croak " Could not copy $_ : $! \n " ;
118
+ my $src = $norecurse ?(dirname($spec ) . ' /' . $_ ):$_ ;
119
+ copy($src , $tgt ) || croak " Could not copy $src : $! \n " ;
115
120
}
116
121
close ($D );
117
122
print " \n " ;
@@ -283,6 +288,78 @@ sub ParseAndCleanRule
283
288
return $flist ;
284
289
}
285
290
291
+ sub CopyIncludeFiles
292
+ {
293
+ my $target = shift ;
294
+
295
+ EnsureDirectories($target , ' include' , ' include/libpq' , ' include/postgresql' ,
296
+ ' include/postgresql/internal' , ' include/postgresql/internal/libpq' ,
297
+ ' include/postgresql/server' );
298
+
299
+ CopyFiles(
300
+ ' Public headers' ,
301
+ $target . ' /include/' ,
302
+ ' src/include/' , ' postgres_ext.h' , ' pg_config.h' , ' pg_config_os.h' , ' pg_config_manual.h'
303
+ );
304
+ copy(' src/include/libpq/libpq-fs.h' , $target . ' /include/libpq/' )
305
+ || croak ' Could not copy libpq-fs.h' ;
306
+
307
+ CopyFiles(' Libpq headers' , $target . ' /include/' , ' src/interfaces/libpq/' , ' libpq-fe.h' );
308
+ CopyFiles(
309
+ ' Libpq internal headers' ,
310
+ $target .' /include/postgresql/internal/' ,
311
+ ' src/interfaces/libpq/' , ' libpq-int.h' , ' pqexpbuffer.h'
312
+ );
313
+
314
+ CopyFiles(
315
+ ' Internal headers' ,
316
+ $target . ' /include/postgresql/internal/' ,
317
+ ' src/include/' , ' c.h' , ' port.h' , ' postgres_fe.h'
318
+ );
319
+ copy(' src/include/libpq/pqcomm.h' , $target . ' /include/postgresql/internal/libpq/' )
320
+ || croak ' Could not copy pqcomm.h' ;
321
+
322
+ CopyFiles(
323
+ ' Server headers' ,
324
+ $target . ' /include/postgresql/server/' ,
325
+ ' src/include/' , ' pg_config.h' , ' pg_config_os.h'
326
+ );
327
+ CopySetOfFiles(' ' , " src\\ include\\ *.h" , $target . ' /include/postgresql/server/' , 1, 1);
328
+ my $D ;
329
+ opendir ($D , ' src/include' ) || croak " Could not opendir on src/include!\n " ;
330
+
331
+ while (my $d = readdir ($D ))
332
+ {
333
+ next if ($d =~ / ^\. / );
334
+ next if ($d eq ' CVS' );
335
+ next unless (-d ' src/include/' . $d );
336
+
337
+ EnsureDirectories($target . ' /include/postgresql/server' , $d );
338
+ system (
339
+ " xcopy /s /i /q /r /y src\\ include\\ $d \\ *.h $target \\ include\\ postgresql\\ server\\ $d \\ " )
340
+ && croak(" Failed to copy include directory $d \n " );
341
+ }
342
+ closedir ($D );
343
+
344
+ my $mf = read_file(' src/interfaces/ecpg/include/Makefile' );
345
+ $mf =~ s {\\ s*[\r\n ]+} {} mg ;
346
+ $mf =~ / ^ecpg_headers\s *=\s *(.*)$ /m || croak " Could not find ecpg_headers line\n " ;
347
+ CopyFiles(
348
+ ' ECPG headers' ,
349
+ $target . ' /include/' ,
350
+ ' src/interfaces/ecpg/include/' ,
351
+ ' ecpg_config.h' , split /\s +/,$1
352
+ );
353
+ $mf =~ / ^informix_headers\s *=\s *(.*)$ /m || croak " Could not find informix_headers line\n " ;
354
+ EnsureDirectories($target . ' /include/postgresql' , ' informix' , ' informix/esql' );
355
+ CopyFiles(
356
+ ' ECPG informix headers' ,
357
+ $target .' /include/postgresql/informix/esql/' ,
358
+ ' src/interfaces/ecpg/include/' ,
359
+ split /\s +/,$1
360
+ );
361
+ }
362
+
286
363
sub GenerateNLSFiles
287
364
{
288
365
my $target = shift ;
0 commit comments