Commit 693c85d9 authored by Bruce Momjian's avatar Bruce Momjian

When using MSVC, disable the building of ecpg if pthreads is not

specified.

Magnus Hagander
parent 0887fa11
...@@ -367,11 +367,13 @@ sub WriteConfiguration ...@@ -367,11 +367,13 @@ sub WriteConfiguration
} }
$libs =~ s/ $//; $libs =~ s/ $//;
$libs =~ s/__CFGNAME__/$cfgname/g; $libs =~ s/__CFGNAME__/$cfgname/g;
my $pth = $self->{solution}->{options}->{pthread};
$pth = '' unless $pth;
print $f <<EOF; print $f <<EOF;
<Configuration Name="$cfgname|Win32" OutputDirectory=".\\$cfgname\\$self->{name}" IntermediateDirectory=".\\$cfgname\\$self->{name}" <Configuration Name="$cfgname|Win32" OutputDirectory=".\\$cfgname\\$self->{name}" IntermediateDirectory=".\\$cfgname\\$self->{name}"
ConfigurationType="$cfgtype" UseOfMFC="0" ATLMinimizesCRunTimeLibraryUsage="FALSE" CharacterSet="2" WholeProgramOptimization="$p->{wholeopt}"> ConfigurationType="$cfgtype" UseOfMFC="0" ATLMinimizesCRunTimeLibraryUsage="FALSE" CharacterSet="2" WholeProgramOptimization="$p->{wholeopt}">
<Tool Name="VCCLCompilerTool" Optimization="$p->{opt}" <Tool Name="VCCLCompilerTool" Optimization="$p->{opt}"
AdditionalIncludeDirectories="src/include;src/include/port/win32;src/include/port/win32_msvc;$self->{solution}->{options}->{pthread};$self->{includes}" AdditionalIncludeDirectories="src/include;src/include/port/win32;src/include/port/win32_msvc;$pth;$self->{includes}"
PreprocessorDefinitions="WIN32;_WINDOWS;__WINDOWS__;__WIN32__;EXEC_BACKEND;WIN32_STACK_RLIMIT=4194304;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE$self->{defines}$p->{defs}" PreprocessorDefinitions="WIN32;_WINDOWS;__WINDOWS__;__WIN32__;EXEC_BACKEND;WIN32_STACK_RLIMIT=4194304;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE$self->{defines}$p->{defs}"
StringPooling="$p->{strpool}" StringPooling="$p->{strpool}"
RuntimeLibrary="$p->{runtime}" DisableSpecificWarnings="$self->{disablewarnings}" RuntimeLibrary="$p->{runtime}" DisableSpecificWarnings="$self->{disablewarnings}"
......
...@@ -6,7 +6,6 @@ use warnings; ...@@ -6,7 +6,6 @@ use warnings;
sub new { sub new {
my $junk = shift; my $junk = shift;
my $options = shift; my $options = shift;
die "Pthreads is required.\n" unless $options->{pthread};
my $self = { my $self = {
projects => {}, projects => {},
options => $options, options => $options,
......
...@@ -90,28 +90,33 @@ $pgtypes->AddDefine('FRONTEND'); ...@@ -90,28 +90,33 @@ $pgtypes->AddDefine('FRONTEND');
$pgtypes->AddReference($postgres,$libpgport); $pgtypes->AddReference($postgres,$libpgport);
$pgtypes->AddIncludeDir('src\interfaces\ecpg\include'); $pgtypes->AddIncludeDir('src\interfaces\ecpg\include');
my $libecpg = $solution->AddProject('libecpg','dll','interfaces','src\interfaces\ecpg\ecpglib'); if ($config->{pthread}) {
$libecpg->AddDefine('FRONTEND'); my $libecpg = $solution->AddProject('libecpg','dll','interfaces','src\interfaces\ecpg\ecpglib');
$libecpg->AddIncludeDir('src\interfaces\ecpg\include'); $libecpg->AddDefine('FRONTEND');
$libecpg->AddIncludeDir('src\interfaces\libpq'); $libecpg->AddIncludeDir('src\interfaces\ecpg\include');
$libecpg->AddIncludeDir('src\port'); $libecpg->AddIncludeDir('src\interfaces\libpq');
$libecpg->AddLibrary('wsock32.lib'); $libecpg->AddIncludeDir('src\port');
$libecpg->AddLibrary($config->{'pthread'} . '\pthreadVC2.lib'); $libecpg->AddLibrary('wsock32.lib');
$libecpg->AddReference($libpq,$pgtypes); $libecpg->AddLibrary($config->{'pthread'} . '\pthreadVC2.lib');
$libecpg->AddReference($libpq,$pgtypes);
my $libecpgcompat = $solution->AddProject('libecpg_compat','dll','interfaces','src\interfaces\ecpg\compatlib');
$libecpgcompat->AddIncludeDir('src\interfaces\ecpg\include'); my $libecpgcompat = $solution->AddProject('libecpg_compat','dll','interfaces','src\interfaces\ecpg\compatlib');
$libecpgcompat->AddIncludeDir('src\interfaces\libpq'); $libecpgcompat->AddIncludeDir('src\interfaces\ecpg\include');
$libecpgcompat->AddReference($pgtypes,$libecpg); $libecpgcompat->AddIncludeDir('src\interfaces\libpq');
$libecpgcompat->AddReference($pgtypes,$libecpg);
my $ecpg = $solution->AddProject('ecpg','exe','interfaces','src\interfaces\ecpg\preproc');
$ecpg->AddIncludeDir('src\interfaces\ecpg\include'); my $ecpg = $solution->AddProject('ecpg','exe','interfaces','src\interfaces\ecpg\preproc');
$ecpg->AddIncludeDir('src\interfaces\libpq'); $ecpg->AddIncludeDir('src\interfaces\ecpg\include');
$ecpg->AddFiles('src\interfaces\ecpg\preproc','pgc.l','preproc.y'); $ecpg->AddIncludeDir('src\interfaces\libpq');
$ecpg->AddDefine('MAJOR_VERSION=4'); $ecpg->AddFiles('src\interfaces\ecpg\preproc','pgc.l','preproc.y');
$ecpg->AddDefine('MINOR_VERSION=2'); $ecpg->AddDefine('MAJOR_VERSION=4');
$ecpg->AddDefine('PATCHLEVEL=1'); $ecpg->AddDefine('MINOR_VERSION=2');
$ecpg->AddReference($libpgport); $ecpg->AddDefine('PATCHLEVEL=1');
$ecpg->AddReference($libpgport);
}
else {
print "Not building ecpg due to lack of pthreads.\n";
}
# src/bin # src/bin
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment