Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .github/workflows/configuration.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,19 @@
<runtime_folder>
</runtime_folder>
</x64>
<arm64>
<libpq version="y">
<include>C:\postgresql_arm64\include</include>
<lib>C:\postgresql_arm64\lib</lib>
<bin>C:\postgresql_arm64\bin</bin>
</libpq>
<setvcvars>
</setvcvars>
<build_macros>
</build_macros>
<runtime_folder>
</runtime_folder>
</arm64>
<BuildResult>
<Date>03/04/2024 10:49:13</Date>
<VisualStudioVersion>17.0</VisualStudioVersion>
Expand Down
340 changes: 339 additions & 1 deletion .github/workflows/main.yml

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions installer/buildInstallers.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
# build 32bit and/or 64bit installers
#
Param(
[ValidateSet("x86", "x64", "both")]
[ValidateSet("x86", "x64", "arm64", "both")]
[string]$cpu="both",
[switch]$AlongWithDrivers,
[switch]$ExcludeRuntime,
Expand Down Expand Up @@ -131,9 +131,9 @@ function findRuntime([int]$toolset_no, [String]$pgmvc)
$pgmvc = "${env:SystemRoot}\syswow64"
}
} else {
if ($env:PROCESSOR_ARCHITECTURE -eq "AMD64") {
if ($env:PROCESSOR_ARCHITECTURE -eq "AMD64" -or $env:PROCESSOR_ARCHITECTURE -eq "ARM64") {
$pgmvc = "${env:SystemRoot}\system32"
} elseif ($env:PROCESSOR_ARCHITEW6432 -eq "AMD64") {
} elseif ($env:PROCESSOR_ARCHITEW6432 -eq "AMD64" -or $env:PROCESSOR_ARCHITEW6432 -eq "ARM64") {
$pgmvc = "${env:SystemRoot}\sysnative"
} else {
throw "${messageSpec}`n$dllinredist doesn't exist unfortunately"
Expand Down
13 changes: 12 additions & 1 deletion installer/psqlodbc_cpu.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<?define CIDSMD = "{E6410EE8-96DC-4d84-8D07-94F8093BF3EF}" ?>
<?define UPGCOD = "BBD29DF5-89F6-4b8b-BDC9-C3EA3A4AFDBB" ?>
<?define ALLUSERS = "1" ?>
<?define PKGINSTVER = "300" ?>
<?elseif $(sys.BUILDARCH) = x86 ?>
<?define Platform = "x86" ?>
<?define PKGNAME = "psqlODBC" ?>
Expand All @@ -18,6 +19,16 @@
<?define CIDSMD = "{22288E09-B3B6-4181-907F-676099C20125}" ?>
<?define UPGCOD = "24BCA538-75A2-4a7f-B236-C99EFC2145DE" ?>
<?define ALLUSERS = "1" ?>
<?define PKGINSTVER = "300" ?>
<?elseif $(sys.BUILDARCH) = arm64 ?>
<?define Platform = "arm64" ?>
<?define PKGNAME = "psqlODBC_arm64" ?>
<?define CIDREG = "EC6364F6-47BE-4528-9073-F029B20C9CB7" ?>
<?define CIDDOC = "8C1CC0E6-D52F-4B06-AE87-C5E79A0D26AF" ?>
<?define CIDSMD = "{2F309CCB-4518-4945-8681-C241F400233B}" ?>
<?define UPGCOD = "4E58DF25-04DA-4DCC-B919-35BFDAFCBA32" ?>
<?define ALLUSERS = "1" ?>
<?define PKGINSTVER = "500" ?>
<?else?><!-- sys.BUILDARCH -->
<?error Invalid build architecture ?>
<?endif?>
Expand All @@ -36,7 +47,7 @@
Name="$(PKGNAME)"
Version="$(VERSION)"
Codepage="1252"
InstallerVersion="300"
InstallerVersion="$(PKGINSTVER)"
Compressed="yes"
Language="1033">

Expand Down
16 changes: 15 additions & 1 deletion installer/psqlodbcm_cpu.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,20 @@
<?else?>
<?define SysFolder = "$(env.SystemRoot)\system32" ?>
<?endif?>
<?elseif $(sys.BUILDARCH) = arm64 ?>
<?define Platform = "arm64" ?>
<?define ModuleName = "psqlODBC_arm64" ?>
<?define BIT64 = "yes" ?>
<?define ANSIFOLDER = "arm64_ANSI_Release" ?>
<?define UNICODEFOLDER = "arm64_Unicode_Release" ?>
<?define Module_PackageId = "CEEFE64C-C79E-46E7-BDF8-F5DD89F9ACCA" ?>
<?define InstallerVersion = "500" ?>
<?define GUIDSEED = "3D4A96A3-7270-4BF5-81B5-3C8E66CE75CB" ?>
<?if $(env.PROCESSOR_ARCHITECTURE) = "ARM64" ?>
<?define SysFolder = "$(env.SystemRoot)\system32" ?>
<?else?>
<?define SysFolder = "$(env.SystemRoot)\sysnative" ?>
<?endif?>
<?else?><!-- sys.BUILDARCH -->
<?error Invalid build architecture ?>
<?endif?>
Expand Down Expand Up @@ -139,7 +153,7 @@
<!-- MSDTC runs in 64bit mode on 64bit machines and 32bit mode on
32bit machines. Install the XA DLL only from a native package.
-->
<Component Id="pgxalib.files" Condition='"$(sys.BUILDARCHSHORT)"="X64" OR NOT VersionNT64'>
<Component Id="pgxalib.files" Condition='"$(sys.BUILDARCHSHORT)"="X64" OR "$(sys.BUILDARCHSHORT)"="A64" OR NOT VersionNT64'>
<File Name="pgxalib.dll" Source="$(BINBASE)/$(UNICODEFOLDER)/pgxalib.dll" />
<RegistryValue Id="pgxalib.reg.1" Root="HKLM" Key="SOFTWARE\Microsoft\MSDTC\XADLL" Name="pgxalib.dll" Type="string" Value="[#pgxalib.dll]" />
</Component>
Expand Down
13 changes: 12 additions & 1 deletion winbuild/BuildAll.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ Param(
[ValidateSet("Build", "Rebuild", "Clean", "info")]
[string]$Target="Build",
[string]$VCVersion,
[ValidateSet("Win32", "x64", "both")]
[ValidateSet("Win32", "x64", "ARM64", "both")]
[string]$Platform="both",
[string]$Toolset,
[ValidateSet("", "4.0", "12.0", "14.0")]
Expand All @@ -76,6 +76,8 @@ function buildPlatform([xml]$configInfo, [string]$Platform)
{
if ($Platform -ieq "x64") {
$platinfo=$configInfo.Configuration.x64
} elseif ($Platform -ieq "ARM64") {
$platinfo=$configInfo.Configuration.arm64
} else {
$platinfo=$configInfo.Configuration.x86
}
Expand Down Expand Up @@ -182,6 +184,15 @@ try {
}
}
#
# build ARM64 dlls
#
if ($recordResult -and ($Platform -ieq "ARM64")) {
buildPlatform $configInfo "ARM64"
if ($LastExitCode -ne 0) {
$recordResult = $false
}
}
#
# Write the result to configuration xml
#
$resultText="successful"
Expand Down
4 changes: 3 additions & 1 deletion winbuild/Psqlodbc-config.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ function getPGDir([xml]$configInfo, [string]$Platform, [string]$kind)
{
if ($Platform -ieq "x64") {
$platinfo=$configInfo.Configuration.x64
} elseif ($Platform -ieq "ARM64") {
$platinfo=$configInfo.Configuration.arm64
} else {
$platinfo=$configInfo.Configuration.x86
}
Expand All @@ -120,7 +122,7 @@ function getPGDir([xml]$configInfo, [string]$Platform, [string]$kind)
if ($result -ne "default") {
return $result
}
if ($Platform -ieq "x64") {
if ($Platform -ieq "x64" -or $Platform -ieq "ARM64") {
if ($env:PROCESSOR_ARCHITECTURE -ieq "x86") {
$pgmfs = $env:ProgramW6432
} else {
Expand Down
10 changes: 10 additions & 0 deletions winbuild/configuration_template.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,16 @@
<build_macros></build_macros>
<runtime_folder></runtime_folder>
</x64>
<arm64>
<libpq version="">
<include>default</include>
<lib>default</lib>
<bin>default</bin>
</libpq>
<setvcvars></setvcvars>
<build_macros></build_macros>
<runtime_folder></runtime_folder>
</arm64>
<BuildResult>
<Date></Date>
<VisualStudioVersion></VisualStudioVersion>
Expand Down
86 changes: 85 additions & 1 deletion winbuild/pgenlist.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|ARM64">
<Configuration>Debug</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|ARM64">
<Configuration>Release</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{DFD90C9A-E9BA-4CA3-812B-E820EE9A3F5B}</ProjectGuid>
Expand Down Expand Up @@ -54,6 +62,21 @@
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<GenerateImportLib>true</GenerateImportLib>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<GenerateImportLib>true</GenerateImportLib>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
Expand All @@ -69,6 +92,12 @@
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" >
<ANSI_VERSION>no</ANSI_VERSION>
</PropertyGroup>
Expand All @@ -87,7 +116,10 @@
<PropertyGroup Condition="'$(Platform)'=='Win32'">
<TARGET_CPU>x86</TARGET_CPU>
</PropertyGroup>
<PropertyGroup Condition="'$(Platform)'!='Win32'">
<PropertyGroup Condition="'$(Platform)'=='ARM64'">
<TARGET_CPU>arm64</TARGET_CPU>
</PropertyGroup>
<PropertyGroup Condition="'$(Platform)'=='x64'">
<TARGET_CPU>x64</TARGET_CPU>
</PropertyGroup>

Expand All @@ -110,6 +142,12 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>

<!-- Import Project="psqlodbc.Cpp.props" / -->

Expand Down Expand Up @@ -205,6 +243,52 @@
</Command>
</PreLinkEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
<ClCompile>
<PreprocessorDefinitions>_HANDLE_ENLIST_IN_DTC_;_CRT_SECURE_NO_DEPRECATE;WIN32;_DEBUG;_WINDOWS;_USRDLL;PGENLIST_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<ImpLib Condition="'$(GenerateImportLib)'=='true'">
<TargetMachine>MachineARM64</TargetMachine>
<ModuleDefinitionFile>$(srcPath)$(targetName).def</ModuleDefinitionFile>
<LinkTimeCodeGeneration>true</LinkTimeCodeGeneration>
</ImpLib>
<Link>
<DelayLoadDLLs>XOLEHLP.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
<AdditionalDependencies>xolehlp.lib;$(Drivername).lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Link>
<CustomBuildStep>
<Command>
</Command>
</CustomBuildStep>
<PreLinkEvent>
<Command>
</Command>
</PreLinkEvent>
<PostBuildEvent>
<Command>
</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
<ClCompile>
<PreprocessorDefinitions>_HANDLE_ENLIST_IN_DTC_;_CRT_SECURE_NO_DEPRECATE;WIN32;NDEBUG;_WINDOWS;_USRDLL;PGENLIST_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<ImpLib Condition="'$(GenerateImportLib)'=='true'">
<TargetMachine>MachineARM64</TargetMachine>
<ModuleDefinitionFile>$(srcPath)$(targetName).def</ModuleDefinitionFile>
<LinkTimeCodeGeneration>true</LinkTimeCodeGeneration>
</ImpLib>
<Link>
<DelayLoadDLLs>XOLEHLP.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
<AdditionalDependencies>xolehlp.lib;$(Drivername).lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Link>
<PreLinkEvent>
<Command>
</Command>
</PreLinkEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(GenerateImportLib)'=='true'">
<Link>
<ModuleDefinitionFile></ModuleDefinitionFile>
Expand Down
Loading