- AssemblerOutput="0" AssemblerListingLocation=".\\debug\\$self->{name}\\" ObjectFile=".\\debug\\$self->{name}\\"
- ProgramDataBaseFileName=".\\debug\\$self->{name}\\" BrowseInformation="0"
+ AssemblerOutput="0" AssemblerListingLocation=".\\$cfgname\\$self->{name}\\" ObjectFile=".\\$cfgname\\$self->{name}\\"
+ ProgramDataBaseFileName=".\\$cfgname\\$self->{name}\\" BrowseInformation="0"
WarningLevel="3" SuppressStartupBanner="TRUE" DebugInformationFormat="3" CompileAs="0"/>
- debug\\$self->{name}\\$self->{name}.$self->{type}"
- AdditionalDependencies="$self->{libraries}"
+ $cfgname\\$self->{name}\\$self->{name}.$self->{type}"
+ AdditionalDependencies="$libs"
LinkIncremental="0" SuppressStartupBanner="TRUE" AdditionalLibraryDirectories="" IgnoreDefaultLibraryNames="libc"
StackReserveSize="4194304" DisableSpecificWarnings="$self->{disablewarnings}"
- GenerateDebugInformation="TRUE" ProgramDatabaseFile=".\\debug\\$self->{name}\\$self->{name}.pdb"
- GenerateMapFile="FALSE" MapFileName=".\\debug\\$self->{name}\\$self->{name}.map"
+ GenerateDebugInformation="TRUE" ProgramDatabaseFile=".\\$cfgname\\$self->{name}\\$self->{name}.pdb"
+ GenerateMapFile="FALSE" MapFileName=".\\$cfgname\\$self->{name}\\$self->{name}.map"
SubSystem="1" TargetMachine="1"
EOF
if ($self->{implib}) {
- print $f "\t\tImportLibrary=\"$self->{implib}\"\n";
+ my $l = $self->{implib};
+ $l =~ s/__CFGNAME__/$cfgname/g;
+ print $f "\t\tImportLibrary=\"$l\"\n";
}
if ($self->{def}) {
- print $f "\t\tModuleDefinitionFile=\"$self->{def}\"\n";
+ my $d = $self->{def};
+ $d =~ s/__CFGNAME__/$cfgname/g;
+ print $f "\t\tModuleDefinitionFile=\"$d\"\n";
}
print $f "\t/>\n";
- print $f "\tDebug\\$self->{name}\\$self->{name}.lib\" IgnoreDefaultLibraryNames=\"libc\" />\n";
+ print $f "\t$cfgname\\$self->{name}\\$self->{name}.lib\" IgnoreDefaultLibraryNames=\"libc\" />\n";
print $f "\t\n";
if ($self->{builddef}) {
- print $f "\tvcbuild\\gendef.pl debug\\$self->{name}\" />\n";
+ print $f "\tsrc\\tools\\msvc\\gendef.pl $cfgname\\$self->{name}\" />\n";
}
# Special case - if config.pl has changed, always return 1
sub IsNewer {
my ($newfile, $oldfile) = @_;
- if ($oldfile ne 'vcbuild\config.pl') {
- return 1 if IsNewer($newfile, 'vcbuild\config.pl');
+ if ($oldfile ne 'src\tools\msvc\config.pl') {
+ return 1 if IsNewer($newfile, 'src\tools\msvc\config.pl');
}
return 1 if (!(-e $newfile));
my @nstat = stat($newfile);
chdir('..\..\..');
}
+ if (IsNewer('src\interfaces\ecpg\include\ecpg_config.h', 'src\interfaces\ecpg\include\ecpg_config.h.in')) {
+ print "Generating ecpg_config.h...\n";
+ open(O,'>','src\interfaces\ecpg\include\ecpg_config.h') || confess "Could not open ecpg_config.h";
+ print O <
+#if (_MSC_VER > 1200)
+#define HAVE_LONG_LONG_INT_64
+#endif
+EOF
+ close(O);
+ }
+
unless (-f "src\\port\\pg_config_paths.h") {
print "Generating pg_config_paths.h...\n";
open(O,'>', 'src\port\pg_config_paths.h') || confess "Could not open pg_config_paths.h";
print SLN <
$proj->{guid}.Debug|Win32.ActiveCfg = Debug|Win32
$proj->{guid}.Debug|Win32.Build.0 = Debug|Win32
+ $proj->{guid}.Release|Win32.ActiveCfg = Release|Win32
$proj->{guid}.Release|Win32.Build.0 = Release|Win32
EOF
}
-@echo off\r
-SET STARTDIR=%CD%\r
-\r
-perl mkvcbuild.pl\r
-if errorlevel 1 goto :eof\r
-\r
-if exist ..\vcbuild if exist ..\src cd ..\r
-\r
-if "%1" == "" msbuild pgsql.sln\r
-if not "%1" == "" vcbuild %1.vcproj\r
-\r
-cd %STARTDIR%\r
+@echo off
+SET STARTDIR=%CD%
+
+perl mkvcbuild.pl
+if errorlevel 1 goto :eof
+
+if exist ..\msvc if exist ..\..\..\src cd ..\..\..
+SET CONFIG=
+if "%1" == "" set CONFIG=Debug
+if "%CONFIG%" == "" if "%1" == "DEBUG" set CONFIG=Debug
+if "%CONFIG%" == "" if "%1" == "RELEASE" set CONFIG=Release
+if not "%CONFIG%" == "" shift
+if "%CONFIG%" == "" set CONFIG=Debug
+
+if "%1" == "" msbuild pgsql.sln /p:Configuration=%CONFIG%
+if not "%1" == "" vcbuild %1.vcproj %CONFIG%
+
+cd %STARTDIR%
use Project;
use Solution;
-chdir('..') if (-d '..\vcbuild' && -d '..\src');
-die 'Must run from root directory or vcbuild directory' unless (-d 'vcbuild' && -d 'src');
-die 'Could not find config.pl' unless (-f 'vcbuild/config.pl');
+chdir('..\..\..') if (-d '..\msvc' && -d '..\..\..\src');
+die 'Must run from root or msvc directory' unless (-d 'src\tools\msvc' && -d 'src');
+die 'Could not find config.pl' unless (-f 'src/tools/msvc/config.pl');
our $config;
-require 'vcbuild/config.pl';
+require 'src/tools/msvc/config.pl';
my $solution = new Solution($config);
$libpq->AddDefine('FRONTEND');
$libpq->AddIncludeDir('src\port');
$libpq->AddLibrary('wsock32.lib');
+$libpq->AddLibrary('wldap32.lib') if ($solution->{options}->{ldap});
$libpq->UseDef('src\interfaces\libpq\libpqdll.def');
$libpq->ReplaceFile('src\interfaces\libpq\libpqrc.c','src\interfaces\libpq\libpq.rc');
$proj->AddIncludeDir('src\bin\psql');
$proj->AddReference($libpq,$libpgport);
$proj->AddResourceFile('src\bin\scripts','PostgreSQL Utility');
- $proj->AddLibrary('debug\libpgport\libpgport.lib');
- $proj->AddLibrary('debug\libpq\libpq.lib');
}
$/ = $t;
$p->AddDir('src\bin\\' . $n);
$p->AddDefine('FRONTEND');
$p->AddReference($libpgport);
- $p->AddLibrary('debug\libpgport\libpgport.lib');
if ($uselibpq) {
$p->AddIncludeDir('src\interfaces\libpq');
$p->AddReference($libpq);
- $p->AddLibrary('debug\libpq\libpq.lib');
}
return $p;
}