# #bsd-kernel # #The BSD kernel for any target supported by BSD and the clang (cross)compiler. #Builds on any host platform supported by clang (ie BSD/Linux/Windows). #This particular project targets the AMD64 platform, but it can easily be #retargeted to any platform supported by the LLVM infrastructure and the BSD #kernel sources. Requires CMake 3.6.3 or later due to the requirements of the #toolchain file (must generate a static library instead of an executable #during the compiler verification step because we need to specify the linker). # ExternalProject_Add ( bsd-kernel PREFIX ${CMAKE_INSTALL_PREFIX} URL http://github.com/freebsd/freebsd/archive/81fb5ce8717f41cc23b2e7d3cea2ab3fc76d85a9.zip URL_MD5 5d75275a40c0db6249f56f191bc17d3c # #Generate CMakeLists.txt in /sys # #PATCH_COMMAND runs with the current directory set to where the source files have been unpacked. #bsd-config wants to run with the current directory set to /sys/amd64/conf, so change #current directory before invoking bsd-config. # PATCH_COMMAND ${CMAKE_COMMAND} chdir $/sys/amd64/conf> $/bin/bsd-config> #The command to generate the BSD cmake file -d $/sys> #Generate CMakeLists.txt in the kernel source directory - required by cmake -s $/sys> #The kernel source directory $/sys/amd64/conf/GENERIC> #This is the kernel config file we will use to generate a cmake script SOURCE_SUBDIR sys #The generated cmake script can be found here when cmake is run during the configure step CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH= -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_TOOLCHAIN_FILE:PATH=${CLANG_FREESTANDING_TOOLCHAIN_FILE} DEPENDS clang-toolchain bsd-config bsd-assym uudecode gawk file2c )