Skip to content

Commit a7e5f7b

Browse files
committed
Provide for client-only installs with MSVC.
MauMau.
1 parent 790eaa6 commit a7e5f7b

File tree

5 files changed

+97
-57
lines changed

5 files changed

+97
-57
lines changed

doc/src/sgml/install-windows.sgml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,14 @@ $ENV{CONFIG}="Debug";
408408
required to initialize and use the database, run the command:
409409
<screen>
410410
<userinput>install c:\destination\directory</userinput>
411+
</screen>
412+
</para>
413+
414+
<para>
415+
If you want to install only the client applications and
416+
interface libraries, then you can use these commands:
417+
<screen>
418+
<userinput>install c:\destination\directory client</userinput>
411419
</screen>
412420
</para>
413421
</sect2>

src/tools/msvc/Install.pm

Lines changed: 82 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,16 @@ our (@ISA, @EXPORT_OK);
1717
@ISA = qw(Exporter);
1818
@EXPORT_OK = qw(Install);
1919

20+
my $insttype;
21+
my @client_contribs = ('oid2name', 'pgbench', 'vacuumlo');
22+
my @client_program_files = (
23+
'clusterdb', 'createdb', 'createlang', 'createuser',
24+
'dropdb', 'droplang', 'dropuser', 'ecpg',
25+
'libecpg', 'libecpg_compat', 'libpgtypes', 'libpq',
26+
'pg_basebackup', 'pg_config', 'pg_dump', 'pg_dumpall',
27+
'pg_isready', 'pg_receivexlog', 'pg_restore', 'psql',
28+
'reindexdb', 'vacuumdb', @client_contribs);
29+
2030
sub lcopy
2131
{
2232
my $src = shift;
@@ -37,6 +47,8 @@ sub Install
3747
$| = 1;
3848

3949
my $target = shift;
50+
$insttype = shift;
51+
$insttype = "all" unless ($insttype);
4052

4153
# if called from vcregress, the config will be passed to us
4254
# so no need to re-include these
@@ -65,24 +77,31 @@ sub Install
6577
my $majorver = DetermineMajorVersion();
6678
print "Installing version $majorver for $conf in $target\n";
6779

68-
EnsureDirectories(
69-
$target, 'bin',
70-
'lib', 'share',
71-
'share/timezonesets', 'share/extension',
72-
'share/contrib', 'doc',
73-
'doc/extension', 'doc/contrib',
74-
'symbols', 'share/tsearch_data');
80+
my @client_dirs = ('bin', 'lib', 'share', 'symbols');
81+
my @all_dirs = (
82+
@client_dirs, 'doc', 'doc/contrib', 'doc/extension', 'share/contrib',
83+
'share/extension', 'share/timezonesets', 'share/tsearch_data');
84+
if ($insttype eq "client")
85+
{
86+
EnsureDirectories($target, @client_dirs);
87+
}
88+
else
89+
{
90+
EnsureDirectories($target, @all_dirs);
91+
}
7592

7693
CopySolutionOutput($conf, $target);
7794
lcopy($target . '/lib/libpq.dll', $target . '/bin/libpq.dll');
7895
my $sample_files = [];
96+
my @top_dir = ("src");
97+
@top_dir = ("src\\bin", "src\\interfaces") if ($insttype eq "client");
7998
File::Find::find(
8099
{ wanted => sub {
81100
/^.*\.sample\z/s
82101
&& push(@$sample_files, $File::Find::name);
83102
}
84103
},
85-
"src");
104+
@top_dir);
86105
CopySetOfFiles('config files', $sample_files, $target . '/share/');
87106
CopyFiles(
88107
'Import libraries',
@@ -95,53 +114,57 @@ sub Install
95114
"libpgport\\libpgport.lib",
96115
"libpgtypes\\libpgtypes.lib",
97116
"libecpg_compat\\libecpg_compat.lib");
98-
CopySetOfFiles(
99-
'timezone names',
100-
[ glob('src\timezone\tznames\*.txt') ],
101-
$target . '/share/timezonesets/');
102-
CopyFiles(
103-
'timezone sets',
104-
$target . '/share/timezonesets/',
105-
'src/timezone/tznames/', 'Default', 'Australia', 'India');
106-
CopySetOfFiles(
107-
'BKI files',
108-
[ glob("src\\backend\\catalog\\postgres.*") ],
109-
$target . '/share/');
110-
CopySetOfFiles(
111-
'SQL files',
112-
[ glob("src\\backend\\catalog\\*.sql") ],
113-
$target . '/share/');
114-
CopyFiles(
115-
'Information schema data', $target . '/share/',
116-
'src/backend/catalog/', 'sql_features.txt');
117-
GenerateConversionScript($target);
118-
GenerateTimezoneFiles($target, $conf);
119-
GenerateTsearchFiles($target);
120-
CopySetOfFiles(
121-
'Stopword files',
122-
[ glob("src\\backend\\snowball\\stopwords\\*.stop") ],
123-
$target . '/share/tsearch_data/');
124-
CopySetOfFiles(
125-
'Dictionaries sample files',
126-
[ glob("src\\backend\\tsearch\\*_sample.*") ],
127-
$target . '/share/tsearch_data/');
128117
CopyContribFiles($config, $target);
129118
CopyIncludeFiles($target);
130119

131-
my $pl_extension_files = [];
132-
my @pldirs = ('src/pl/plpgsql/src');
133-
push @pldirs, "src/pl/plperl" if $config->{perl};
134-
push @pldirs, "src/pl/plpython" if $config->{python};
135-
push @pldirs, "src/pl/tcl" if $config->{tcl};
136-
File::Find::find(
137-
{ wanted => sub {
138-
/^(.*--.*\.sql|.*\.control)\z/s
139-
&& push(@$pl_extension_files, $File::Find::name);
140-
}
141-
},
142-
@pldirs);
143-
CopySetOfFiles('PL Extension files',
144-
$pl_extension_files, $target . '/share/extension/');
120+
if ($insttype ne "client")
121+
{
122+
CopySetOfFiles(
123+
'timezone names',
124+
[ glob('src\timezone\tznames\*.txt') ],
125+
$target . '/share/timezonesets/');
126+
CopyFiles(
127+
'timezone sets',
128+
$target . '/share/timezonesets/',
129+
'src/timezone/tznames/', 'Default', 'Australia', 'India');
130+
CopySetOfFiles(
131+
'BKI files',
132+
[ glob("src\\backend\\catalog\\postgres.*") ],
133+
$target . '/share/');
134+
CopySetOfFiles(
135+
'SQL files',
136+
[ glob("src\\backend\\catalog\\*.sql") ],
137+
$target . '/share/');
138+
CopyFiles(
139+
'Information schema data', $target . '/share/',
140+
'src/backend/catalog/', 'sql_features.txt');
141+
GenerateConversionScript($target);
142+
GenerateTimezoneFiles($target, $conf);
143+
GenerateTsearchFiles($target);
144+
CopySetOfFiles(
145+
'Stopword files',
146+
[ glob("src\\backend\\snowball\\stopwords\\*.stop") ],
147+
$target . '/share/tsearch_data/');
148+
CopySetOfFiles(
149+
'Dictionaries sample files',
150+
[ glob("src\\backend\\tsearch\\*_sample.*") ],
151+
$target . '/share/tsearch_data/');
152+
153+
my $pl_extension_files = [];
154+
my @pldirs = ('src/pl/plpgsql/src');
155+
push @pldirs, "src/pl/plperl" if $config->{perl};
156+
push @pldirs, "src/pl/plpython" if $config->{python};
157+
push @pldirs, "src/pl/tcl" if $config->{tcl};
158+
File::Find::find(
159+
{ wanted => sub {
160+
/^(.*--.*\.sql|.*\.control)\z/s
161+
&& push(@$pl_extension_files, $File::Find::name);
162+
}
163+
},
164+
@pldirs);
165+
CopySetOfFiles('PL Extension files',
166+
$pl_extension_files, $target . '/share/extension/');
167+
}
145168

146169
GenerateNLSFiles($target, $config->{nls}, $majorver) if ($config->{nls});
147170

@@ -218,6 +241,10 @@ sub CopySolutionOutput
218241

219242
$sln =~ s/$rem//;
220243

244+
next
245+
if ($insttype eq "client" && !grep { $_ eq $pf }
246+
@client_program_files);
247+
221248
my $proj = read_file("$pf.$vcproj")
222249
|| croak "Could not open $pf.$vcproj\n";
223250
if ($vcproj eq 'vcproj' && $proj =~ qr{ConfigurationType="([^"]+)"})
@@ -378,6 +405,9 @@ sub CopyContribFiles
378405
{
379406
next if ($d =~ /^\./);
380407
next unless (-f "contrib/$d/Makefile");
408+
next
409+
if ($insttype eq "client" && !grep { $_ eq $d } @client_contribs);
410+
381411
next if ($d eq "uuid-ossp" && !defined($config->{uuid}));
382412
next if ($d eq "sslinfo" && !defined($config->{openssl}));
383413
next if ($d eq "xml2" && !defined($config->{xml}));

src/tools/msvc/install.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ CALL bldenv.bat
2020
del bldenv.bat
2121
:nobuildenv
2222

23-
perl install.pl "%1"
23+
perl install.pl "%1" %2
2424

2525
REM exit fix for pre-2003 shell especially if used on buildfarm
2626
if "%XP_EXIT_FIX%" == "yes" exit %ERRORLEVEL%

src/tools/msvc/install.pl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,12 @@
99
use Install qw(Install);
1010

1111
my $target = shift || Usage();
12-
Install($target);
12+
my $insttype = shift;
13+
Install($target, $insttype);
1314

1415
sub Usage
1516
{
16-
print "Usage: install.pl <targetdir>\n";
17+
print "Usage: install.pl <targetdir> [installtype]\n";
18+
print "installtype: client\n";
1719
exit(1);
1820
}

src/tools/msvc/vcregress.pl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ sub isolationcheck
150150
{
151151
chdir "../isolation";
152152
copy("../../../$Config/isolationtester/isolationtester.exe",
153-
"../../../$Config/pg_isolation_regress");
153+
"../../../$Config/pg_isolation_regress");
154154
my @args = (
155155
"../../../$Config/pg_isolation_regress/pg_isolation_regress",
156156
"--psqldir=../../../$Config/psql",
@@ -252,7 +252,7 @@ sub upgradecheck
252252
(mkdir $tmp_root || die $!) unless -d $tmp_root;
253253
my $tmp_install = "$tmp_root/install";
254254
print "Setting up temp install\n\n";
255-
Install($tmp_install, $config);
255+
Install($tmp_install, "all", $config);
256256

257257
# Install does a chdir, so change back after that
258258
chdir $cwd;

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