git.postgresql.org Git - postgresql.git/commitdiff

git projects / postgresql.git / commitdiff
? search:
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 52be3aa)
MSVC: Recognize PGFILEDESC in contrib and conversion_procs modules.
2014年7月14日 18:07:21 +0000 (14:07 -0400)
2014年7月14日 18:07:21 +0000 (14:07 -0400)
Achieve this by consistently using four-argument Solution::AddProject()
calls. Remove ad hoc Makefile parsing made redundant by doing that.

Michael Paquier and Noah Misch, reviewed by MauMau.


diff --git a/src/tools/msvc/Mkvcbuild.pm b/src/tools/msvc/Mkvcbuild.pm
index 8002f2348775d4456c97e59b93a8cf68769e930b..71450f47739c405106686d54f974a0b0c57b8d50 100644 (file)
--- a/src/tools/msvc/Mkvcbuild.pm
+++ b/src/tools/msvc/Mkvcbuild.pm
@@ -474,8 +474,10 @@ sub mkvcbuild
push @contrib_excludes, 'uuid-ossp';
}
- # Pgcrypto makefile too complex to parse....
- my $pgcrypto = $solution->AddProject('pgcrypto', 'dll', 'crypto');
+ # AddProject() does not recognize the constructs used to populate OBJS in
+ # the pgcrypto Makefile, so it will discover no files.
+ my $pgcrypto =
+ $solution->AddProject('pgcrypto', 'dll', 'crypto', 'contrib\\pgcrypto');
$pgcrypto->AddFiles(
'contrib\pgcrypto', 'pgcrypto.c',
'px.c', 'px-hmac.c',
@@ -527,18 +529,9 @@ sub mkvcbuild
|| die 'Could not match in conversion makefile' . "\n";
foreach my $sub (split /\s+/, 1ドル)
{
- my $mf = Project::read_file(
- 'src\backend\utils\mb\conversion_procs\\' . $sub . '\Makefile');
- my $p = $solution->AddProject($sub, 'dll', 'conversion procs');
- $p->AddFile('src\backend\utils\mb\conversion_procs\\'
- . $sub . '\\'
- . $sub
- . '.c');
- if ($mf =~ m{^SRCS\s*\+=\s*(.*)$}m)
- {
- $p->AddFile(
- 'src\backend\utils\mb\conversion_procs\\' . $sub . '\\' . 1ドル);
- }
+ my $dir = 'src\backend\utils\mb\conversion_procs\\' . $sub;
+ my $p = $solution->AddProject($sub, 'dll', 'conversion procs', $dir);
+ $p->AddFile("$dir\\$sub.c"); # implicit source file
$p->AddReference($postgres);
}
@@ -646,44 +639,17 @@ sub AddContrib
if ($mf =~ /^MODULE_big\s*=\s*(.*)$/mg)
{
my $dn = 1ドル;
- $mf =~ s{\\\s*[\r\n]+}{}mg;
- my $proj = $solution->AddProject($dn, 'dll', 'contrib');
- $mf =~ /^OBJS\s*=\s*(.*)$/gm
- || croak "Could not find objects in MODULE_big for $n\n";
- my $objs = 1ドル;
- while ($objs =~ /\b([\w-]+\.o)\b/g)
- {
- my $o = 1ドル;
- $o =~ s/\.o$/.c/;
- $proj->AddFile('contrib\\' . $n . '\\' . $o);
- }
+ my $proj =
+ $solution->AddProject($dn, 'dll', 'contrib', 'contrib\\' . $n);
$proj->AddReference($postgres);
- if ($mf =~ /^SUBDIRS\s*:?=\s*(.*)$/mg)
- {
- foreach my $d (split /\s+/, 1ドル)
- {
- my $mf2 = Project::read_file(
- 'contrib\\' . $n . '\\' . $d . '\Makefile');
- $mf2 =~ s{\\\s*[\r\n]+}{}mg;
- $mf2 =~ /^SUBOBJS\s*=\s*(.*)$/gm
- || croak
- "Could not find objects in MODULE_big for $n, subdir $d\n";
- $objs = 1ドル;
- while ($objs =~ /\b([\w-]+\.o)\b/g)
- {
- my $o = 1ドル;
- $o =~ s/\.o$/.c/;
- $proj->AddFile('contrib\\' . $n . '\\' . $d . '\\' . $o);
- }
- }
- }
AdjustContribProj($proj);
}
elsif ($mf =~ /^MODULES\s*=\s*(.*)$/mg)
{
foreach my $mod (split /\s+/, 1ドル)
{
- my $proj = $solution->AddProject($mod, 'dll', 'contrib');
+ my $proj =
+ $solution->AddProject($mod, 'dll', 'contrib', 'contrib\\' . $n);
$proj->AddFile('contrib\\' . $n . '\\' . $mod . '.c');
$proj->AddReference($postgres);
AdjustContribProj($proj);
@@ -691,17 +657,8 @@ sub AddContrib
}
elsif ($mf =~ /^PROGRAM\s*=\s*(.*)$/mg)
{
- my $proj = $solution->AddProject(1,ドル 'exe', 'contrib');
- $mf =~ s{\\\s*[\r\n]+}{}mg;
- $mf =~ /^OBJS\s*=\s*(.*)$/gm
- || croak "Could not find objects in PROGRAM for $n\n";
- my $objs = 1ドル;
- while ($objs =~ /\b([\w-]+\.o)\b/g)
- {
- my $o = 1ドル;
- $o =~ s/\.o$/.c/;
- $proj->AddFile('contrib\\' . $n . '\\' . $o);
- }
+ my $proj =
+ $solution->AddProject(1,ドル 'exe', 'contrib', 'contrib\\' . $n);
AdjustContribProj($proj);
}
else
@@ -717,6 +674,7 @@ sub GenerateContribSqlFiles
{
my $n = shift;
my $mf = shift;
+ $mf =~ s{\\\s*[\r\n]+}{}mg;
if ($mf =~ /^DATA_built\s*=\s*(.*)$/mg)
{
my $l = 1ドル;
diff --git a/src/tools/msvc/clean.bat b/src/tools/msvc/clean.bat
index e06838cc1ef12c92b2bc9bc51ab1df91608cc86f..4671f30e50c4eaba8e139c8abf6d7d0120dd6670 100755 (executable)
--- a/src/tools/msvc/clean.bat
+++ b/src/tools/msvc/clean.bat
@@ -19,6 +19,8 @@ if exist pgsql.suo del /q /a:H pgsql.suo
del /s /q src\bin\win32ver.rc 2> NUL
del /s /q src\interfaces\win32ver.rc 2> NUL
if exist src\backend\win32ver.rc del /q src\backend\win32ver.rc
+for /d %%f in (contrib\*) do if exist %%f\win32ver.rc del /q %%f\win32ver.rc
+for /d %%f in (src\backend\utils\mb\conversion_procs\*) do if exist %%f\win32ver.rc del /q %%f\win32ver.rc
REM Delete files created with GenerateFiles() in Solution.pm
if exist src\include\pg_config.h del /q src\include\pg_config.h
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /