Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 81622ac

Browse files
committed
Install include files
1 parent 418834f commit 81622ac

File tree

1 file changed

+84
-7
lines changed

1 file changed

+84
-7
lines changed

src/tools/msvc/Install.pm

Lines changed: 84 additions & 7 deletions
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.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 $
77
#
88
use strict;
99
use warnings;
@@ -44,9 +44,9 @@ sub Install
4444
copy($target . '/lib/libpq.dll', $target . '/bin/libpq.dll');
4545
CopySetOfFiles('config files', "*.sample", $target . '/share/');
4646
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"
5050
);
5151
CopySetOfFiles('timezone names', 'src\timezone\tznames\*.txt',$target . '/share/timezonesets/');
5252
CopyFiles(
@@ -64,6 +64,7 @@ sub Install
6464
GenerateConversionScript($target);
6565
GenerateTimezoneFiles($target,$conf);
6666
CopyContribFiles($target);
67+
CopyIncludeFiles($target);
6768

6869
GenerateNLSFiles($target,$config->{nls}) if ($config->{nls});
6970
}
@@ -101,17 +102,21 @@ sub CopySetOfFiles
101102
my $what = shift;
102103
my $spec = shift;
103104
my $target = shift;
105+
my $silent = shift;
106+
my $norecurse = shift;
104107
my $D;
105108

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";
108112
while (<$D>)
109113
{
110114
chomp;
111115
next if /regress/; # Skip temporary install in regression subdir
112116
my $tgt = $target . basename($_);
113117
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";
115120
}
116121
close($D);
117122
print "\n";
@@ -283,6 +288,78 @@ sub ParseAndCleanRule
283288
return $flist;
284289
}
285290

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+
286363
sub GenerateNLSFiles
287364
{
288365
my $target = shift;

0 commit comments

Comments
 (0)