Skip to content

Commit afe86d6

Browse files
committed
Work in progress to modify the native binary CoreCLR build.
1 parent 4e23d6e commit afe86d6

5 files changed

Lines changed: 54 additions & 34 deletions

File tree

src/powershell-native/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ SET (WIN_VERSION_WINXP 0x0501)
6262

6363
#include(dsc_defs.cmake)
6464
if (BUILD_ONECORE)
65-
include(nano_defs.cmake)
65+
include(coreclr_defs.cmake)
66+
#include(nano_defs.cmake)
6667
else ()
6768
include(coreclr_defs.cmake)
6869
endif (BUILD_ONECORE)

src/powershell-native/Install-PowerShellRemoting.ps1

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,15 @@
1313

1414
param
1515
(
16-
[Switch]$Verbose
16+
[parameter(ParameterSetName = "ByPath")]
17+
[ValidateNotNullOrEmpty()]
18+
[string]
19+
$PowerShellHome,
20+
21+
[parameter(ParameterSetName = "ByPath")]
22+
[ValidateNotNullOrEmpty()]
23+
[string]
24+
$PowerShellVersion
1725
)
1826

1927
function Register-WinRmPlugin
@@ -74,13 +82,18 @@ function Generate-PluginConfigFile
7482
[string]
7583
[parameter(Mandatory=$true)]
7684
[ValidateNotNullOrEmpty()]
77-
$pluginFile
85+
$pluginFile,
86+
87+
[string]
88+
[parameter(Mandatory=$true)]
89+
[ValidateNotNullOrEmpty()]
90+
$powershellHomeDir
7891
)
7992

8093
# This always overwrites the file with a new version of it if the
8194
# script is invoked multiple times.
82-
Set-Content -Path $pluginFile -Value "PSHOMEDIR=$PSHOME"
83-
Add-Content -Path $pluginFile -Value "CORECLRDIR=$PSHOME"
95+
Set-Content -Path $pluginFile -Value "PSHOMEDIR=$powershellHomeDir"
96+
Add-Content -Path $pluginFile -Value "CORECLRDIR=$powershellHomeDir"
8497

8598
Write-Verbose "Created Plugin Config File: $pluginFile"
8699
}
@@ -103,7 +116,9 @@ if ($Verbose)
103116
$VerbosePreference = "Continue"
104117
}
105118

106-
$powershellVersion = $PSVersionTable.PSVersion
119+
$powershellVersion = $PowershellVersion
120+
$powershellHome = $PowerShellHome
121+
107122
$pluginBasePath = Join-Path "$env:WINDIR\System32\PowerShell" $powerShellVersion
108123

109124
$resolvedPluginAbsolutePath = ""
@@ -122,10 +137,10 @@ $pluginRawPath = Join-Path $resolvedPluginAbsolutePath "pwrshplugin.dll"
122137
$fixedPluginPath = $pluginRawPath -replace '\\','\\'
123138

124139
# This is forced to ensure the the file is placed correctly
125-
Copy-Item $PSHOME\pwrshplugin.dll $resolvedPluginAbsolutePath -Force -Verbose
140+
Copy-Item $powershellHome\pwrshplugin.dll $resolvedPluginAbsolutePath -Force -Verbose
126141

127142
$pluginFile = Join-Path $resolvedPluginAbsolutePath "RemotePowerShellConfig.txt"
128-
Generate-PluginConfigFile $pluginFile
143+
Generate-PluginConfigFile $pluginFile $powershellHome
129144

130145
$pluginEndpointName = "powershell.$powershellVersion"
131146

src/powershell-native/coreclr_defs.cmake

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -171,13 +171,6 @@ add_compile_options($<$<OR:$<CONFIG:Debug>,$<CONFIG:Checked>>:/MTd>)
171171
# clr_unknown_arch()
172172
#endif (CLR_CMAKE_TARGET_ARCH_AMD64)
173173

174-
#
175-
# TODO: Are these needed???????????
176-
#
177-
#add_definitions(-D_BLD_CLR)
178-
#add_definitions(-DDEBUGGING_SUPPORTED)
179-
#add_definitions(-DPROFILING_SUPPORTED)
180-
181174
add_definitions(-DWIN32)
182175
add_definitions(-D_WIN32)
183176
add_definitions(-DWINVER=${WIN_VERSION_WIN8})# 0x0601 for Win7, was 0x0602

src/powershell-native/nativemsh/pwrshexe/CMakeLists.txt

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,17 @@ if (BUILD_ONECORE)
88
CssMainEntry.cpp
99
)
1010
set(PWRSHEXE_WINDOWS_LIBS
11-
### ${STATIC_MT_CRT_LIB}
12-
### ${STATIC_MT_VCRT_LIB}
13-
### ${STATIC_UCRT_LIB}
1411
onecore.lib
15-
vcruntime.lib
16-
ucrtd.lib
17-
msvcrt.lib
18-
msvcrt.lib
19-
msvcprtd.lib
20-
user32.lib
21-
atls.lib
12+
${STATIC_MT_CRT_LIB} # use for coreclr_defs
13+
${STATIC_MT_VCRT_LIB} # use for coreclr_defs
14+
### ${STATIC_UCRT_LIB}
15+
#vcruntime.lib# use for nano_defs
16+
#ucrtd.li# use for nano_defs
17+
#msvcrt.lib# use for nano_defs
18+
#msvcrt.lib# use for nano_defs
19+
#msvcprtd.lib# use for nano_defs
20+
#user32.lib # use for nano_defs
21+
#atls.lib# use for nano_defs
2222
)
2323
set(powershell_definitions
2424
_CONSOLE

src/powershell-native/nativemsh/pwrshplugin/CMakeLists.txt

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,27 @@ add_library(pwrshplugin SHARED
1313
if (BUILD_ONECORE)
1414
# Libraries to use when creating this binary for Windows on OneCore-based SKUs
1515
set(PWRSHPLUGIN_WINDOWS_LIBS
16-
### ${STATIC_MT_CRT_LIB}
17-
### ${STATIC_MT_VCRT_LIB}
16+
${STATIC_MT_CRT_LIB} # use for coreclr_defs
17+
${STATIC_MT_VCRT_LIB} # use for coreclr_defs
1818
### ${STATIC_UCRT_LIB}
19-
onecore.lib
20-
vcruntime.lib
21-
ucrtd.lib
22-
msvcrt.lib
23-
msvcprtd.lib
24-
user32.lib
25-
atls.lib
19+
20+
kernel32.lib
21+
advapi32.lib
22+
ole32.lib
23+
#oleaut32.lib
24+
#uuid.lib
25+
#user32.lib
26+
#version.lib
27+
#shlwapi.lib
28+
#bcrypt.lib
29+
30+
#onecore.lib #use for nano_defs
31+
#vcruntime.lib # use for nano_defs
32+
#ucrtd.lib # use for nano_defs
33+
#msvcrt.lib # use for nano_defs
34+
#msvcprtd.lib # use for nano_defs
35+
#user32.lib # use for nano_defs
36+
#atls.lib # use for nano_defs
2637
wsmsvc.lib
2738
)
2839
set_target_properties(pwrshplugin PROPERTIES COMPILE_DEFINITIONS "CORECLR")

0 commit comments

Comments
 (0)