Skip to content
Merged
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
1 change: 1 addition & 0 deletions eng/Configurations.props
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
<TargetOS Condition="'$(TargetOS)' == '' and $([MSBuild]::IsOSPlatform('OSX'))">OSX</TargetOS>
<TargetOS Condition="'$(TargetOS)' == '' and $([MSBuild]::IsOSPlatform('FREEBSD'))">FreeBSD</TargetOS>
<TargetOS Condition="'$(TargetOS)' == '' and $([MSBuild]::IsOSPlatform('NETBSD'))">NetBSD</TargetOS>
<TargetOS Condition="'$(TargetOS)' == '' and $([MSBuild]::IsOSPlatform('SUNOS'))">SunOS</TargetOS>
<TargetOS Condition="'$(TargetOS)' == '' and $([MSBuild]::IsOSUnixLike())">Linux</TargetOS>
<TargetOS Condition="'$(TargetOS)' == '' and $([MSBuild]::IsOSPlatform('WINDOWS'))">Windows_NT</TargetOS>
<CoreCLRTargetOS Condition="'$(CoreCLRTargetOS)' == ''">$(TargetOS)</CoreCLRTargetOS>
Expand Down
22 changes: 11 additions & 11 deletions eng/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ usage()
{
echo "Common settings:"
echo " --subset Build a subset, print available subsets with -subset help (short: -s)"
echo " --os Build operating system: Windows_NT, Linux, FreeBSD, OSX, tvOS, iOS, Android or Browser"
echo " --os Build operating system: Windows_NT, Linux, FreeBSD, OSX, tvOS, iOS, Android, Browser, NetBSD or SunOS"
echo " --arch Build platform: x86, x64, arm, armel, arm64 or wasm"
echo " --configuration Build configuration: Debug, Release or [CoreCLR]Checked (short: -c)"
echo " --runtimeConfiguration Runtime build configuration: Debug, Release or [CoreCLR]Checked (short: -rc)"
Expand Down Expand Up @@ -108,24 +108,24 @@ while [[ $# > 0 ]]; do
exit 0
;;
-subset|-s)
if [ -z ${2+x} ]; then
if [ -z ${2+x} ]; then
arguments="$arguments /p:Subset=help"
shift 1
else
else
arguments="$arguments /p:Subset=$2"
shift 2
fi
;;
-arch)
if [ -z ${2+x} ]; then
if [ -z ${2+x} ]; then
echo "No architecture supplied. See help (--help) for supported architectures." 1>&2
exit 1
fi
arch=$2
shift 2
;;
-configuration|-c)
if [ -z ${2+x} ]; then
if [ -z ${2+x} ]; then
echo "No configuration supplied. See help (--help) for supported configurations." 1>&2
exit 1
fi
Expand All @@ -134,7 +134,7 @@ while [[ $# > 0 ]]; do
shift 2
;;
-framework|-f)
if [ -z ${2+x} ]; then
if [ -z ${2+x} ]; then
echo "No framework supplied. See help (--help) for supported frameworks." 1>&2
exit 1
fi
Expand All @@ -143,7 +143,7 @@ while [[ $# > 0 ]]; do
shift 2
;;
-os)
if [ -z ${2+x} ]; then
if [ -z ${2+x} ]; then
echo "No target operating system supplied. See help (--help) for supported target operating systems." 1>&2
exit 1
fi
Expand All @@ -156,7 +156,7 @@ while [[ $# > 0 ]]; do
shift 1
;;
-testscope)
if [ -z ${2+x} ]; then
if [ -z ${2+x} ]; then
echo "No test scope supplied. See help (--help) for supported test scope values." 1>&2
exit 1
fi
Expand All @@ -172,7 +172,7 @@ while [[ $# > 0 ]]; do
shift 1
;;
-runtimeconfiguration|-rc)
if [ -z ${2+x} ]; then
if [ -z ${2+x} ]; then
echo "No runtime configuration supplied. See help (--help) for supported runtime configurations." 1>&2
exit 1
fi
Expand All @@ -181,7 +181,7 @@ while [[ $# > 0 ]]; do
shift 2
;;
-librariesconfiguration|-lc)
if [ -z ${2+x} ]; then
if [ -z ${2+x} ]; then
echo "No libraries configuration supplied. See help (--help) for supported libraries configurations." 1>&2
exit 1
fi
Expand All @@ -198,7 +198,7 @@ while [[ $# > 0 ]]; do
shift 1
;;
-cmakeargs)
if [ -z ${2+x} ]; then
if [ -z ${2+x} ]; then
echo "No cmake args supplied." 1>&2
exit 1
fi
Expand Down
2 changes: 1 addition & 1 deletion eng/native/build-commons.sh
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ done
# Get the number of processors available to the scheduler
# Other techniques such as `nproc` only get the number of
# processors available to a single process.
platform=$(uname)
platform="$(uname)"
if [[ "$platform" == "FreeBSD" ]]; then
__NumProc=$(sysctl hw.ncpu | awk '{ print $2+1 }')
elif [[ "$platform" == "NetBSD" || "$platform" == "SunOS" ]]; then
Expand Down
14 changes: 7 additions & 7 deletions eng/native/configurecompiler.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -227,15 +227,13 @@ if (CLR_CMAKE_HOST_UNIX)

if(CLR_CMAKE_HOST_OSX)
message("Detected OSX x86_64")
endif(CLR_CMAKE_HOST_OSX)

if(CLR_CMAKE_HOST_FREEBSD)
elseif(CLR_CMAKE_HOST_FREEBSD)
message("Detected FreeBSD amd64")
endif(CLR_CMAKE_HOST_FREEBSD)

if(CLR_CMAKE_HOST_NETBSD)
elseif(CLR_CMAKE_HOST_NETBSD)
message("Detected NetBSD amd64")
endif(CLR_CMAKE_HOST_NETBSD)
elseif(CLR_CMAKE_HOST_SUNOS)
message("Detected SunOS amd64")
endif(CLR_CMAKE_HOST_SUNOS)
endif(CLR_CMAKE_HOST_UNIX)

if (CLR_CMAKE_HOST_WIN32)
Expand Down Expand Up @@ -373,6 +371,8 @@ if(CLR_CMAKE_TARGET_UNIX)
add_definitions(-DTARGET_LINUX)
elseif(CLR_CMAKE_TARGET_NETBSD)
add_definitions(-DTARGET_NETBSD)
elseif(CLR_CMAKE_TARGET_SUNOS)
add_definitions(-DTARGET_SUNOS)
elseif(CLR_CMAKE_TARGET_ANDROID)
add_definitions(-DTARGET_ANDROID)
endif()
Expand Down
23 changes: 13 additions & 10 deletions eng/run-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ wait_on_pids()

usage()
{
echo "Runs .NET CoreFX tests on FreeBSD, NetBSD or Linux"
echo "Runs .NET CoreFX tests on FreeBSD, Linux, NetBSD or SunOS"
echo "usage: run-test [options]"
echo
echo "Input sources:"
echo " --runtime <location> Location of root of the binaries directory"
echo " containing the FreeBSD, NetBSD or Linux runtime"
echo " containing the FreeBSD, Linux, NetBSD or SunOS runtime"
echo " default: <repo_root>/bin/testhost/netcoreapp-<OS>-<Configuration>-<Arch>"
echo " --corefx-tests <location> Location of the root binaries location containing"
echo " the tests to run"
Expand All @@ -29,7 +29,7 @@ usage()
echo "Flavor/OS/Architecture options:"
echo " --configuration <config> Configuration to run (Debug/Release)"
echo " default: Debug"
echo " --os <os> OS to run (FreeBSD, NetBSD or Linux)"
echo " --os <os> OS to run (FreeBSD, Linux, NetBSD or SunOS)"
echo " default: detect current OS"
echo " --arch <Architecture> Architecture to run (x64, arm, armel, x86, arm64)"
echo " default: detect current architecture"
Expand Down Expand Up @@ -236,34 +236,34 @@ done

# Compute paths to the binaries if they haven't already been computed

if [ "$Runtime" == "" ]
if [ -z "$Runtime" ]
then
Runtime="$ProjectRoot/artifacts/bin/testhost/netcoreapp-$OS-$Configuration-$__Arch"
fi

if [ "$CoreFxTests" == "" ]
if [ -z "$CoreFxTests" ]
then
CoreFxTests="$ProjectRoot/artifacts/bin"
fi

# Check parameters up front for valid values:

if [ ! "$Configuration" == "Debug" ] && [ ! "$Configuration" == "Release" ]
if [ "$Configuration" != "Debug" ] && [ "$Configuration" != "Release" ]
then
echo "error: Configuration should be Debug or Release"
exit 1
fi

if [ ! "$OS" == "FreeBSD" ] && [ ! "$OS" == "NetBSD" ] && [ ! "$OS" == "Linux" ]
if [ "$OS" != "FreeBSD" ] && [ "$OS" != "Linux" ] && [ "$OS" != "NetBSD" ] && [ "$OS" != "SunOS" ]
then
echo "error: OS should be FreeBSD, NetBSD or Linux"
echo "error: OS should be FreeBSD, Linux, NetBSD or Linux"
exit 1
fi

export CORECLR_SERVER_GC="$serverGC"
export PAL_OUTPUTDEBUGSTRING="1"

if [ "$LANG" == "" ]
if [ -z "$LANG" ]
then
export LANG="en_US.UTF-8"
fi
Expand All @@ -285,7 +285,10 @@ if [ $RunTestSequential -eq 1 ]
then
maxProcesses=1;
else
if [ `uname` = "NetBSD" ] || [ `uname` = "FreeBSD" ]; then
platform="$(uname)"
if [ "$platform" = "FreeBSD" ]; then
maxProcesses=$(sysctl hw.ncpu | awk '{ print $2+1 }')
if [ "$platform" = "NetBSD" ] || [ "$platform" = "SunOS" ] ; then
maxProcesses=$(($(getconf NPROCESSORS_ONLN)+1))
else
maxProcesses=$(($(getconf _NPROCESSORS_ONLN)+1))
Expand Down
7 changes: 7 additions & 0 deletions eng/targetframeworksuffix.props
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,13 @@
<PackageTargetRuntime>netbsd</PackageTargetRuntime>
</PropertyGroup>
</When>
<When Condition="'$(TargetFrameworkSuffix)' == 'SunOS'">
<PropertyGroup>
<TargetsUnix>true</TargetsUnix>
<TargetsSunOS>true</TargetsSunOS>
<PackageTargetRuntime>sunos</PackageTargetRuntime>
</PropertyGroup>
</When>
<When Condition="'$(TargetFrameworkSuffix)' == 'Browser'">
<PropertyGroup>
<TargetsLinux>true</TargetsLinux>
Expand Down
3 changes: 2 additions & 1 deletion src/coreclr/dir.common.props
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,11 @@
<TargetsFreeBSD Condition="'$(TargetOS)' == 'FreeBSD'">true</TargetsFreeBSD>
<TargetsLinux Condition="'$(TargetOS)' == 'Linux'">true</TargetsLinux>
<TargetsNetBSD Condition="'$(TargetOS)' == 'NetBSD'">true</TargetsNetBSD>
<TargetsSunOS Condition="'$(TargetOS)' == 'SunOS'">true</TargetsSunOS>
<TargetsOSX Condition="'$(TargetOS)' == 'OSX'">true</TargetsOSX>
<TargetsWindows Condition="'$(TargetOS)' == 'Windows_NT'">true</TargetsWindows>

<TargetsUnix Condition="'$(TargetsFreeBSD)' == 'true' or '$(TargetsLinux)' == 'true' or '$(TargetsNetBSD)' == 'true' or '$(TargetsOSX)' == 'true'">true</TargetsUnix>
<TargetsUnix Condition="'$(TargetsFreeBSD)' == 'true' or '$(TargetsLinux)' == 'true' or '$(TargetsNetBSD)' == 'true' or '$(TargetsOSX)' == 'true' or '$(TargetsSunOS)' == 'true'">true</TargetsUnix>

<!-- We are only tracking Linux Distributions for Nuget RID mapping -->
<DistroRid Condition="'$(TargetsLinux)' == 'true'">$(__DistroRid)</DistroRid>
Expand Down
23 changes: 12 additions & 11 deletions src/coreclr/run-cppcheck.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ usage()
check_dependencies()
{
# Check presence of cppcheck on the path
if [ "$RunCppCheck" == true ]
if [ "$RunCppCheck" = "true" ]
then
hash cppcheck 2>/dev/null || { echo >&2 "Please install cppcheck before running this script"; exit 1; }
fi

# Check presence of sloccount on the path
if [ "$RunSlocCount" == true ]
if [ "$RunSlocCount" = "true" ]
then
hash sloccount 2>/dev/null || { echo >&2 "Please install sloccount before running this script"; exit 1; }
fi
Expand All @@ -39,9 +39,10 @@ SloccountOutput="sloccount.sc"
# Get the number of processors available to the scheduler
# Other techniques such as `nproc` only get the number of
# processors available to a single process.
if [ `uname` = "FreeBSD" ]; then
NumProc=`sysctl hw.ncpu | awk '{ print $2+1 }'`
elif [ `uname` = "NetBSD" ]; then
platform="$(uname)"
if [ "$platform" = "FreeBSD" ]; then
NumProc=$(sysctl hw.ncpu | awk '{ print $2+1 }')
elif [ "$platform" = "NetBSD" || "$platform" = "SunOS" ]; then
NumProc=$(($(getconf NPROCESSORS_ONLN)+1))
else
NumProc=$(($(getconf _NPROCESSORS_ONLN)+1))
Expand Down Expand Up @@ -80,19 +81,19 @@ do
esac
done

if [ "$FilesFromArgs" != "" ];
if [ -n "$FilesFromArgs" ];
then
Files=$FilesFromArgs
fi

if [ "$CppCheckOutput" == "" ];
if [ -z "$CppCheckOutput" ];
then
echo "Expected: file for cppcheck output"
usage
exit 1
fi

if [ "$SloccountOutput" == "" ];
if [ -z "$SloccountOutput" ];
then
echo "Expected: file for sloccount output"
usage
Expand All @@ -101,14 +102,14 @@ fi

check_dependencies

if [ "$RunCppCheck" == true ]
if [ "$RunCppCheck" = "true" ]
then
echo "Running cppcheck for files: $Files"
cppcheck --enable=all -j $NumProc --xml --xml-version=2 --force $Files 2> $CppCheckOutput
CppCheckOutputs="$CppCheckOutput (cppcheck)"
fi

if [ "$RunSlocCount" == true ]
if [ "$RunSlocCount" = "true" ]
then
echo "Running sloccount for files: $Files"
sloccount --wide --details $Files > $SloccountOutput
Expand Down
22 changes: 21 additions & 1 deletion src/coreclr/src/.nuget/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

<RuntimeOS Condition="'$(RuntimeOS)' == ''">$(OSRid)</RuntimeOS>

<SupportedPackageOSGroups Condition="'$(SupportedPackageOSGroups)' == ''">Windows_NT;OSX;Android;Linux;FreeBSD</SupportedPackageOSGroups>
<SupportedPackageOSGroups Condition="'$(SupportedPackageOSGroups)' == ''">Windows_NT;OSX;Android;Linux;FreeBSD;NetBSD;SunOS</SupportedPackageOSGroups>
<SupportedPackageOSGroups>;$(SupportedPackageOSGroups);</SupportedPackageOSGroups>

<!-- Identify OS family based upon the RuntimeOS, which could be distro specific (e.g. osx.10.12) or
Expand Down Expand Up @@ -96,6 +96,20 @@
<PackageRID Condition="'$(PortableBuild)' == 'true'">freebsd-$(TargetArchitecture)</PackageRID>
</PropertyGroup>
</When>
<When Condition="'$(_runtimeOSFamily)' == 'netbsd'">
<PropertyGroup>
<PackageRID>netbsd-$(TargetArchitecture)</PackageRID>
<!-- Set the platform part of the RID if we are doing a portable build -->
<PackageRID Condition="'$(PortableBuild)' == 'true'">netbsd-$(TargetArchitecture)</PackageRID>
</PropertyGroup>
</When>
<When Condition="'$(_runtimeOSFamily)' == 'sunos'">
<PropertyGroup>
<PackageRID>sunos-$(TargetArchitecture)</PackageRID>
<!-- Set the platform part of the RID if we are doing a portable build -->
<PackageRID Condition="'$(PortableBuild)' == 'true'">sunos-$(TargetArchitecture)</PackageRID>
</PropertyGroup>
</When>
<When Condition="'$(_runtimeOSFamily)' == 'android'">
<PropertyGroup>
<PackageRID>android.21-$(TargetArchitecture)</PackageRID>
Expand Down Expand Up @@ -159,6 +173,12 @@
<ItemGroup Condition="$(SupportedPackageOSGroups.Contains(';FreeBSD;'))">
<OfficialBuildRID Include="freebsd-x64" />
</ItemGroup>
<ItemGroup Condition="$(SupportedPackageOSGroups.Contains(';NetBSD;'))">
<OfficialBuildRID Include="netbsd-x64" />
</ItemGroup>
<ItemGroup Condition="$(SupportedPackageOSGroups.Contains(';SunOS;'))">
<OfficialBuildRID Include="sunos-x64" />
</ItemGroup>
<ItemGroup Condition="$(SupportedPackageOSGroups.Contains(';Windows_NT;'))">
<OfficialBuildRID Include="win-x86">
<Platform>x86</Platform>
Expand Down
Loading