Merge pull request #6943 from mellinoe/fedora-24
[platform/upstream/coreclr.git] / build.sh
1 #!/usr/bin/env bash
2
3 # resolve python-version to use
4 if [ "$PYTHON" == "" ]; then
5     if hash python 2>/dev/null; then
6        PYTHON=python
7     elif hash python2 2>/dev/null; then
8        PYTHON=python2
9     elif hash python2.7 2>/dev/null; then
10        PYTHON=python2.7
11     else
12        echo "Unable to locate build-dependency python2.x!" 1>&2
13        exit 1
14     fi
15 fi
16
17 # validate python-dependency
18 # useful in case of explicitly set option.
19 if ! hash $PYTHON 2>/dev/null; then
20    echo "Unable to locate build-dependency python2.x ($PYTHON)!" 1>&2
21    exit 1
22 fi
23
24 usage()
25 {
26     echo "Usage: $0 [BuildArch] [BuildType] [verbose] [coverage] [cross] [clangx.y] [ninja] [configureonly] [skipconfigure] [skipnative] [skipmscorlib] [skiptests] [cmakeargs] [bindir]"
27     echo "BuildArch can be: x64, x86, arm, arm-softfp, arm64"
28     echo "BuildType can be: debug, checked, release"
29     echo "coverage - optional argument to enable code coverage build (currently supported only for Linux and OSX)."
30     echo "ninja - target ninja instead of GNU make"
31     echo "clangx.y - optional argument to build using clang version x.y."
32     echo "cross - optional argument to signify cross compilation,"
33     echo "      - will use ROOTFS_DIR environment variable if set."
34     echo "configureonly - do not perform any builds; just configure the build."
35     echo "skipconfigure - skip build configuration."
36     echo "skipnative - do not build native components."
37     echo "skipmscorlib - do not build mscorlib.dll."
38     echo "skiptests - skip the tests in the 'tests' subdirectory."
39     echo "skipnuget - skip building nuget packages."
40     echo "verbose - optional argument to enable verbose build output."
41     echo "-skiprestore: skip restoring packages ^(default: packages are restored during build^)."
42         echo "-disableoss: Disable Open Source Signing for System.Private.CoreLib."
43         echo "-sequential: force a non-parallel build ^(default is to build in parallel"
44         echo "   using all processors^)."
45         echo "-officialbuildid=^<ID^>: specify the official build ID to be used by this build."
46         echo "-Rebuild: passes /t:rebuild to the build projects."
47     echo "skipgenerateversion - disable version generation even if MSBuild is supported."
48     echo "cmakeargs - user-settable additional arguments passed to CMake."
49     echo "bindir - output directory (defaults to $__ProjectRoot/bin)"
50
51     exit 1
52 }
53
54 initDistroRid()
55 {
56     if [ "$__BuildOS" == "Linux" ]; then
57         if [ ! -e /etc/os-release ]; then
58             echo "WARNING: Can not determine runtime id for current distro."
59             export __DistroRid=""
60         else
61             source /etc/os-release
62             export __DistroRid="$ID.$VERSION_ID-$__HostArch"
63         fi
64     fi
65 }
66
67 setup_dirs()
68 {
69     echo Setting up directories for build
70
71     mkdir -p "$__RootBinDir"
72     mkdir -p "$__BinDir"
73     mkdir -p "$__LogsDir"
74     mkdir -p "$__IntermediatesDir"
75 }
76
77 # Check the system to ensure the right prereqs are in place
78
79 check_prereqs()
80 {
81     echo "Checking prerequisites..."
82
83     # Check presence of CMake on the path
84     hash cmake 2>/dev/null || { echo >&2 "Please install cmake before running this script"; exit 1; }
85
86     # Check for clang
87     hash clang-$__ClangMajorVersion.$__ClangMinorVersion 2>/dev/null ||  hash clang$__ClangMajorVersion$__ClangMinorVersion 2>/dev/null ||  hash clang 2>/dev/null || { echo >&2 "Please install clang-$__ClangMajorVersion.$__ClangMinorVersion before running this script"; exit 1; }
88
89 }
90
91 build_coreclr()
92 {
93
94     if [ $__SkipCoreCLR == 1 ]; then
95         echo "Skipping CoreCLR build."
96         return
97     fi
98
99 # Event Logging Infrastructure
100    __GeneratedIntermediate="$__IntermediatesDir/Generated"
101    __GeneratedIntermediateEventProvider="$__GeneratedIntermediate/eventprovider_new"
102     if [[ -d "$__GeneratedIntermediateEventProvider" ]]; then
103         rm -rf  "$__GeneratedIntermediateEventProvider"
104     fi
105
106     if [[ ! -d "$__GeneratedIntermediate/eventprovider" ]]; then
107         mkdir -p "$__GeneratedIntermediate/eventprovider"
108     fi
109
110     mkdir -p "$__GeneratedIntermediateEventProvider"
111     if [[ $__SkipCoreCLR == 0 || $__ConfigureOnly == 1 ]]; then
112         echo "Laying out dynamically generated files consumed by the build system "
113         echo "Laying out dynamically generated Event Logging Test files"
114         $PYTHON -B -Wall -Werror "$__ProjectRoot/src/scripts/genXplatEventing.py" --man "$__ProjectRoot/src/vm/ClrEtwAll.man" --exc "$__ProjectRoot/src/vm/ClrEtwAllMeta.lst" --testdir "$__GeneratedIntermediateEventProvider/tests"
115
116         if  [[ $? != 0 ]]; then
117             exit
118         fi
119
120         #determine the logging system
121         case $__BuildOS in
122             Linux)
123                 echo "Laying out dynamically generated Event Logging Implementation of Lttng"
124                 $PYTHON -B -Wall -Werror "$__ProjectRoot/src/scripts/genXplatLttng.py" --man "$__ProjectRoot/src/vm/ClrEtwAll.man" --intermediate "$__GeneratedIntermediateEventProvider"
125                 if  [[ $? != 0 ]]; then
126                     exit
127                 fi
128                 ;;
129             *)
130                 ;;
131         esac
132     fi
133
134     echo "Cleaning the temp folder of dynamically generated Event Logging files"
135     $PYTHON -B -Wall -Werror -c "import sys;sys.path.insert(0,\"$__ProjectRoot/src/scripts\"); from Utilities import *;UpdateDirectory(\"$__GeneratedIntermediate/eventprovider\",\"$__GeneratedIntermediateEventProvider\")"
136     if  [[ $? != 0 ]]; then
137         exit
138     fi
139
140     rm -rf "$__GeneratedIntermediateEventProvider"
141
142     # All set to commence the build
143
144     echo "Commencing build of native components for $__BuildOS.$__BuildArch.$__BuildType in $__IntermediatesDir"
145
146     generator=""
147     buildFile="Makefile"
148     buildTool="make"
149     if [ $__UseNinja == 1 ]; then
150         generator="ninja"
151         buildFile="build.ninja"
152         if hash ninja 2>/dev/null; then
153             buildTool="ninja"
154         elif hash ninja-build 2>/dev/null; then
155             buildTool="ninja-build"
156         else
157            echo "Unable to locate ninja!" 1>&2
158            exit 1
159         fi
160     fi
161
162     if [ $__SkipConfigure == 0 ]; then
163         # if msbuild is not supported, then set __SkipGenerateVersion to 1
164         if [ $__isMSBuildOnNETCoreSupported == 0 ]; then __SkipGenerateVersion=1; fi
165         # Drop version.c file
166         __versionSourceFile=$__IntermediatesDir/version.cpp
167         if [ $__SkipGenerateVersion == 0 ]; then
168             "$__ProjectRoot/run.sh" build -Project=$__ProjectDir/build.proj -generateHeaderUnix -NativeVersionSourceFile=$__versionSourceFile $__RunArgs $__UnprocessedBuildArgs
169         else
170             __versionSourceLine="static char sccsid[] __attribute__((used)) = \"@(#)No version information produced\";"
171             echo $__versionSourceLine > $__versionSourceFile
172         fi
173
174                 pushd "$__IntermediatesDir"
175         # Regenerate the CMake solution
176         echo "Invoking \"$__ProjectRoot/src/pal/tools/gen-buildsys-clang.sh\" \"$__ProjectRoot\" $__ClangMajorVersion $__ClangMinorVersion $__BuildArch $__BuildType $__CodeCoverage $__IncludeTests $generator $__cmakeargs"
177         "$__ProjectRoot/src/pal/tools/gen-buildsys-clang.sh" "$__ProjectRoot" $__ClangMajorVersion $__ClangMinorVersion $__BuildArch $__BuildType $__CodeCoverage $__IncludeTests $generator "$__cmakeargs"
178         popd
179     fi
180
181     # Check that the makefiles were created.
182     pushd "$__IntermediatesDir"
183     
184     if [ ! -f "$__IntermediatesDir/$buildFile" ]; then
185         echo "Failed to generate native component build project!"
186         exit 1
187     fi
188
189     # Get the number of processors available to the scheduler
190     # Other techniques such as `nproc` only get the number of
191     # processors available to a single process.
192     if [ `uname` = "FreeBSD" ]; then
193         NumProc=`sysctl hw.ncpu | awk '{ print $2+1 }'`
194     elif [ `uname` = "NetBSD" ]; then
195         NumProc=$(($(getconf NPROCESSORS_ONLN)+1))
196     else
197         NumProc=$(($(getconf _NPROCESSORS_ONLN)+1))
198     fi
199
200     # Build CoreCLR
201
202     if [ $__ConfigureOnly == 1 ]; then
203         echo "Skipping CoreCLR build."
204         return
205     fi
206
207     echo "Executing $buildTool install -j $NumProc"
208
209     $buildTool install -j $NumProc
210     if [ $? != 0 ]; then
211         echo "Failed to build coreclr components."
212         exit 1
213     fi
214         popd
215 }
216
217 isMSBuildOnNETCoreSupported()
218 {
219     # This needs to be updated alongwith corresponding changes to netci.groovy.
220     __isMSBuildOnNETCoreSupported=0
221
222     if [ "$__HostArch" == "x64" ]; then
223         if [ "$__HostOS" == "Linux" ]; then
224             case "$__DistroRid" in
225                 "centos.7-x64")
226                     __isMSBuildOnNETCoreSupported=1
227                     ;;
228                 "debian.8-x64")
229                     __isMSBuildOnNETCoreSupported=1
230                     ;;
231                 "fedora.23-x64")
232                     __isMSBuildOnNETCoreSupported=1
233                     ;;
234                 "fedora.24-x64")
235                     __isMSBuildOnNETCoreSupported=1
236                     ;;
237                 "opensuse.13.2-x64")
238                     __isMSBuildOnNETCoreSupported=1
239                     ;;
240                 "opensuse.42.1-x64")
241                     __isMSBuildOnNETCoreSupported=1
242                     ;;
243                 "rhel.7.2-x64")
244                     __isMSBuildOnNETCoreSupported=1
245                     ;;
246                 "ubuntu.14.04-x64")
247                     __isMSBuildOnNETCoreSupported=1
248                     ;;
249                 "ubuntu.16.04-x64")
250                     __isMSBuildOnNETCoreSupported=1
251                     ;;
252                 "ubuntu.16.10-x64")
253                     __isMSBuildOnNETCoreSupported=1
254                     ;;
255                 *)
256             esac
257         elif [ "$__HostOS" == "OSX" ]; then
258             __isMSBuildOnNETCoreSupported=1
259         fi
260     fi
261 }
262
263 build_CoreLib_ni()
264 {
265     if [ $__SkipCoreCLR == 0 -a -e $__BinDir/crossgen ]; then
266         echo "Generating native image for System.Private.CoreLib."
267         $__BinDir/crossgen $__BinDir/System.Private.CoreLib.dll
268         if [ $? -ne 0 ]; then
269             echo "Failed to generate native image for System.Private.CoreLib."
270             exit 1
271         fi
272
273         echo "Generating native image for MScorlib Facade."
274         $__BinDir/crossgen $__BinDir/mscorlib.dll
275         if [ $? -ne 0 ]; then
276             echo "Failed to generate native image for mscorlib facade."
277             exit 1
278         fi
279
280         if [ "$__BuildOS" == "Linux" ]; then
281             echo "Generating symbol file for System.Private.CoreLib."
282             $__BinDir/crossgen /CreatePerfMap $__BinDir $__BinDir/System.Private.CoreLib.ni.dll
283             if [ $? -ne 0 ]; then
284                 echo "Failed to generate symbol file for System.Private.CoreLib."
285                 exit 1
286             fi
287         fi
288     fi
289 }
290
291 build_CoreLib()
292 {
293
294     if [ $__isMSBuildOnNETCoreSupported == 0 ]; then
295         echo "System.Private.CoreLib.dll build unsupported."
296         return
297     fi
298
299     if [ $__SkipMSCorLib == 1 ]; then
300        echo "Skipping building System.Private.CoreLib."
301        return
302     fi
303
304     echo "Commencing build of managed components for $__BuildOS.$__BuildArch.$__BuildType"
305
306     # Invoke MSBuild
307     $__ProjectRoot/run.sh build -Project=$__ProjectDir/build.proj -MsBuildLog="/flp:Verbosity=normal;LogFile=$__LogsDir/System.Private.CoreLib_$__BuildOS__$__BuildArch__$__BuildType.log" -BuildTarget -__IntermediatesDir=$__IntermediatesDir -__RootBinDir=$__RootBinDir -BuildNugetPackage=false -UseSharedCompilation=false $__RunArgs $__UnprocessedBuildArgs
308
309     if [ $? -ne 0 ]; then
310         echo "Failed to build managed components."
311         exit 1
312     fi
313
314     # The cross build generates a crossgen with the target architecture.
315     if [ $__CrossBuild != 1 ]; then
316        # The architecture of host pc must be same architecture with target.
317        if [[ ( "$__HostArch" == "$__BuildArch" ) ]]; then
318            build_CoreLib_ni
319        elif [[ ( "$__HostArch" == "x64" ) && ( "$__BuildArch" == "x86" ) ]]; then
320            build_CoreLib_ni
321        elif [[ ( "$__HostArch" == "arm64" ) && ( "$__BuildArch" == "arm" ) ]]; then
322            build_CoreLib_ni
323        else 
324            exit 1
325        fi
326     fi 
327 }
328
329 generate_NugetPackages()
330 {
331     # We can only generate nuget package if we also support building mscorlib as part of this build.
332     if [ $__isMSBuildOnNETCoreSupported == 0 ]; then
333         echo "Nuget package generation unsupported."
334         return
335     fi
336
337     # Since we can build mscorlib for this OS, did we build the native components as well?
338     if [ $__SkipCoreCLR == 1 ]; then
339         echo "Unable to generate nuget packages since native components were not built."
340         return
341     fi
342
343     echo "Generating nuget packages for "$__BuildOS
344
345     # Build the packages
346     $__ProjectRoot/run.sh build -Project=$__SourceDir/.nuget/packages.builds -MsBuildLog="/flp:Verbosity=normal;LogFile=$__LogsDir/Nuget_$__BuildOS__$__BuildArch__$__BuildType.log" -BuildTarget -__IntermediatesDir=$__IntermediatesDir -__RootBinDir=$__RootBinDir -BuildNugetPackage=false -UseSharedCompilation=false $__RunArgs $__UnprocessedBuildArgs
347
348     if [ $? -ne 0 ]; then
349         echo "Failed to generate Nuget packages."
350         exit 1
351     fi
352 }
353
354 echo "Commencing CoreCLR Repo build"
355
356 # Argument types supported by this script:
357 #
358 # Build architecture - valid values are: x64, ARM.
359 # Build Type         - valid values are: Debug, Checked, Release
360 #
361 # Set the default arguments for build
362
363 # Obtain the location of the bash script to figure out where the root of the repo is.
364 __ProjectRoot="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
365
366 # Use uname to determine what the CPU is.
367 CPUName=$(uname -p)
368 # Some Linux platforms report unknown for platform, but the arch for machine.
369 if [ "$CPUName" == "unknown" ]; then
370     CPUName=$(uname -m)
371 fi
372
373 case $CPUName in
374     i686)
375         echo "Unsupported CPU $CPUName detected, build might not succeed!"
376         __BuildArch=x86
377         __HostArch=x86
378         ;;
379
380     x86_64)
381         __BuildArch=x64
382         __HostArch=x64
383         ;;
384
385     armv7l)
386         echo "Unsupported CPU $CPUName detected, build might not succeed!"
387         __BuildArch=arm
388         __HostArch=arm
389         ;;
390
391     aarch64)
392         echo "Unsupported CPU $CPUName detected, build might not succeed!"
393         __BuildArch=arm64
394         __HostArch=arm64
395         ;;
396
397     *)
398         echo "Unknown CPU $CPUName detected, configuring as if for x64"
399         __BuildArch=x64
400         __HostArch=x64
401         ;;
402 esac
403
404 # Use uname to determine what the OS is.
405 OSName=$(uname -s)
406 case $OSName in
407     Linux)
408         __BuildOS=Linux
409         __HostOS=Linux
410         ;;
411
412     Darwin)
413         __BuildOS=OSX
414         __HostOS=OSX
415         ;;
416
417     FreeBSD)
418         __BuildOS=FreeBSD
419         __HostOS=FreeBSD
420         ;;
421
422     OpenBSD)
423         __BuildOS=OpenBSD
424         __HostOS=OpenBSD
425         ;;
426
427     NetBSD)
428         __BuildOS=NetBSD
429         __HostOS=NetBSD
430         ;;
431
432     SunOS)
433         __BuildOS=SunOS
434         __HostOS=SunOS
435         ;;
436
437     *)
438         echo "Unsupported OS $OSName detected, configuring as if for Linux"
439         __BuildOS=Linux
440         __HostOS=Linux
441         ;;
442 esac
443
444 __BuildType=Debug
445 __CodeCoverage=
446 __IncludeTests=Include_Tests
447
448 # Set the various build properties here so that CMake and MSBuild can pick them up
449 __ProjectDir="$__ProjectRoot"
450 __SourceDir="$__ProjectDir/src"
451 __PackagesDir="$__ProjectDir/packages"
452 __RootBinDir="$__ProjectDir/bin"
453 __UnprocessedBuildArgs=
454 __RunArgs=
455 __MSBCleanBuildArgs=
456 __UseNinja=0
457 __VerboseBuild=0
458 __ConfigureOnly=0
459 __SkipConfigure=0
460 __SkipRestore=""
461 __SkipNuget=0
462 __SkipCoreCLR=0
463 __SkipMSCorLib=0
464 __CrossBuild=0
465 __ClangMajorVersion=0
466 __ClangMinorVersion=0
467 __NuGetPath="$__PackagesDir/NuGet.exe"
468 __DistroRid=""
469 __cmakeargs=""
470 __SkipGenerateVersion=0
471
472 while :; do
473     if [ $# -le 0 ]; then
474         break
475     fi
476
477     lowerI="$(echo $1 | awk '{print tolower($0)}')"
478     case $lowerI in
479         -\?|-h|--help)
480             usage
481             exit 1
482             ;;
483
484         x86)
485             __BuildArch=x86
486             ;;
487
488         x64)
489             __BuildArch=x64
490             ;;
491
492         arm)
493             __BuildArch=arm
494             ;;
495
496         arm-softfp)
497             __BuildArch=arm-softfp
498             ;;
499
500         arm64)
501             __BuildArch=arm64
502             ;;
503
504         debug)
505             __BuildType=Debug
506             ;;
507
508         checked)
509             __BuildType=Checked
510             ;;
511
512         release)
513             __BuildType=Release
514             ;;
515
516         coverage)
517             __CodeCoverage=Coverage
518             ;;
519
520         cross)
521             __CrossBuild=1
522             ;;
523
524                 verbose)
525         __VerboseBuild=1
526         ;;
527
528         clang3.5)
529             __ClangMajorVersion=3
530             __ClangMinorVersion=5
531             ;;
532
533         clang3.6)
534             __ClangMajorVersion=3
535             __ClangMinorVersion=6
536             ;;
537
538         clang3.7)
539             __ClangMajorVersion=3
540             __ClangMinorVersion=7
541             ;;
542
543         clang3.8)
544             __ClangMajorVersion=3
545             __ClangMinorVersion=8
546             ;;
547
548         clang3.9)
549             __ClangMajorVersion=3
550             __ClangMinorVersion=9
551             ;;
552
553         ninja)
554             __UseNinja=1
555             ;;
556
557         configureonly)
558             __ConfigureOnly=1
559             __SkipMSCorLib=1
560             __SkipNuget=1
561             __IncludeTests=
562             ;;
563
564         skipconfigure)
565             __SkipConfigure=1
566             ;;
567
568         skipnative)
569             # Use "skipnative" to use the same option name as build.cmd.
570             __SkipCoreCLR=1
571             ;;
572
573         skipcoreclr)
574             # Accept "skipcoreclr" for backwards-compatibility.
575             __SkipCoreCLR=1
576             ;;
577
578         skipmscorlib)
579             __SkipMSCorLib=1
580             ;;
581
582         skipgenerateversion)
583             __SkipGenerateVersion=1
584             ;;
585
586         includetests)
587             ;;
588
589         skiptests)
590             __IncludeTests=
591             ;;
592
593         skipnuget)
594             __SkipNuget=1
595             ;;
596
597         cmakeargs)
598             if [ -n "$2" ]; then
599                 __cmakeargs="$2"
600                 shift
601             else
602                 echo "ERROR: 'cmakeargs' requires a non-empty option argument"
603                 exit 1
604             fi
605             ;;
606
607         bindir)
608             if [ -n "$2" ]; then
609                 __RootBinDir="$2"
610                 if [ ! -d $__RootBinDir ]; then
611                     mkdir $__RootBinDir
612                 fi
613                 __RootBinParent=$(dirname $__RootBinDir)
614                 __RootBinName=${__RootBinDir##*/}
615                 __RootBinDir="$(cd $__RootBinParent &>/dev/null && printf %s/%s $PWD $__RootBinName)"
616                 shift
617             else
618                 echo "ERROR: 'bindir' requires a non-empty option argument"
619                 exit 1
620             fi
621             ;;
622
623         *)
624             __UnprocessedBuildArgs="$__UnprocessedBuildArgs $1"
625             ;;
626     esac
627
628     shift
629 done
630
631 __RunArgs="-BuildArch=$__BuildArch -BuildType=$__BuildType -BuildOS=$__BuildOS"
632
633 # Configure environment if we are doing a verbose build
634 if [ $__VerboseBuild == 1 ]; then
635     export VERBOSE=1
636         __RunArgs="$__RunArgs -verbose"
637 fi
638
639 # Set default clang version
640 if [[ $__ClangMajorVersion == 0 && $__ClangMinorVersion == 0 ]]; then
641     if [ $__CrossBuild == 1 ]; then
642         __ClangMajorVersion=3
643         __ClangMinorVersion=6
644     else
645         __ClangMajorVersion=3
646         __ClangMinorVersion=5
647     fi
648 fi
649
650 # Set dependent variables
651 __LogsDir="$__RootBinDir/Logs"
652
653 # init the distro name
654 initDistroRid
655
656 # Set the remaining variables based upon the determined build configuration
657 __BinDir="$__RootBinDir/Product/$__BuildOS.$__BuildArch.$__BuildType"
658 __PackagesBinDir="$__BinDir/.nuget"
659 __ToolsDir="$__RootBinDir/tools"
660 __TestWorkingDir="$__RootBinDir/tests/$__BuildOS.$__BuildArch.$__BuildType"
661 export __IntermediatesDir="$__RootBinDir/obj/$__BuildOS.$__BuildArch.$__BuildType"
662 __TestIntermediatesDir="$__RootBinDir/tests/obj/$__BuildOS.$__BuildArch.$__BuildType"
663 __isMSBuildOnNETCoreSupported=0
664
665 # Init if MSBuild for .NET Core is supported for this platform
666 isMSBuildOnNETCoreSupported
667
668 # CI_SPECIFIC - On CI machines, $HOME may not be set. In such a case, create a subfolder and set the variable to set.
669 # This is needed by CLI to function.
670 if [ -z "$HOME" ]; then
671     if [ ! -d "$__ProjectDir/temp_home" ]; then
672         mkdir temp_home
673     fi
674     export HOME=$__ProjectDir/temp_home
675     echo "HOME not defined; setting it to $HOME"
676 fi
677
678 # Specify path to be set for CMAKE_INSTALL_PREFIX.
679 # This is where all built CoreClr libraries will copied to.
680 export __CMakeBinDir="$__BinDir"
681
682 # Configure environment if we are doing a cross compile.
683 if [ $__CrossBuild == 1 ]; then
684     export CROSSCOMPILE=1
685     if ! [[ -n "$ROOTFS_DIR" ]]; then
686         export ROOTFS_DIR="$__ProjectRoot/cross/rootfs/$__BuildArch"
687     fi
688 fi
689
690 # Make the directories necessary for build if they don't exist
691
692 setup_dirs
693
694 # Check prereqs.
695
696 check_prereqs
697
698 # Build the coreclr (native) components.
699
700 build_coreclr
701
702 # Build System.Private.CoreLib.
703
704 build_CoreLib
705
706 # Generate nuget packages
707 if [ $__SkipNuget != 1 ]; then
708     generate_NugetPackages
709 fi
710
711
712 # Build complete
713
714 echo "Repo successfully built."
715 echo "Product binaries are available at $__BinDir"
716 exit 0