Adding initial CMake toolchains.
This commit is contained in:
parent
2c76506974
commit
35b4b1303b
9 changed files with 312 additions and 11 deletions
31
cmake/aarch64-apple-darwin22.4.cmake
Normal file
31
cmake/aarch64-apple-darwin22.4.cmake
Normal file
|
@ -0,0 +1,31 @@
|
|||
#
|
||||
# Kangaroo Punch Toolchains
|
||||
# Copyright 2023-2024 Scott Duensing <scott@kangaroopunch.com>
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the “Software”), to
|
||||
# deal in the Software without restriction, including without limitation the
|
||||
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
# sell copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in
|
||||
# all copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
# IN THE SOFTWARE.
|
||||
#
|
||||
|
||||
|
||||
set(OSXCROSS_HOST aarch64-apple-darwin22.4)
|
||||
set(CMAKE_SYSTEM_PROCESSOR aarch64)
|
||||
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/apple-darwin-common.cmake)
|
||||
|
||||
set(KANGAROO_OS macos)
|
||||
set(KANGAROO_ARCH aarch64)
|
66
cmake/apple-darwin-common.cmake
Normal file
66
cmake/apple-darwin-common.cmake
Normal file
|
@ -0,0 +1,66 @@
|
|||
#
|
||||
# Kangaroo Punch Toolchains
|
||||
# Copyright 2023-2024 Scott Duensing <scott@kangaroopunch.com>
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the “Software”), to
|
||||
# deal in the Software without restriction, including without limitation the
|
||||
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
# sell copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in
|
||||
# all copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
# IN THE SOFTWARE.
|
||||
#
|
||||
|
||||
|
||||
macro(osxcross_getconf VAR)
|
||||
if(NOT ${VAR})
|
||||
set(${VAR} "$ENV{${VAR}}")
|
||||
if(${VAR})
|
||||
set(${VAR} "${${VAR}}" CACHE STRING "${VAR}")
|
||||
message(STATUS "Found ${VAR}: ${${VAR}}")
|
||||
else()
|
||||
message(FATAL_ERROR "Cannot determine \"${VAR}\"")
|
||||
endif()
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
|
||||
osxcross_getconf(OSXCROSS_TARGET_DIR)
|
||||
osxcross_getconf(OSXCROSS_TARGET)
|
||||
osxcross_getconf(OSXCROSS_SDK)
|
||||
|
||||
set(OSXCROSS_LOCATION $ENV{OSXCROSS_LOCATION})
|
||||
set(CMAKE_SYSTEM_NAME "Darwin")
|
||||
set(CMAKE_C_COMPILER "${OSXCROSS_TARGET_DIR}/bin/${OSXCROSS_HOST}-clang")
|
||||
set(CMAKE_C_COMPILER_TARGET ${OSXCROSS_HOST})
|
||||
set(CMAKE_CXX_COMPILER "${OSXCROSS_TARGET_DIR}/bin/${OSXCROSS_HOST}-clang++")
|
||||
set(CMAKE_CXX_COMPILER_TARGET ${OSXCROSS_HOST})
|
||||
set(CMAKE_EXE_LINKER_FLAGS "-fuse-ld=\"${OSXCROSS_TARGET_DIR}/bin/${OSXCROSS_HOST}-ld\"")
|
||||
|
||||
set(CMAKE_FIND_ROOT_PATH
|
||||
"${CMAKE_FIND_ROOT_PATH}"
|
||||
"${OSXCROSS_SDK}"
|
||||
"${OSXCROSS_TARGET_DIR}/macports/pkgs/opt/local"
|
||||
)
|
||||
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
|
||||
|
||||
set(CMAKE_AR "${OSXCROSS_TARGET_DIR}/bin/${OSXCROSS_HOST}-ar" CACHE FILEPATH "ar")
|
||||
set(CMAKE_RANLIB "${OSXCROSS_TARGET_DIR}/bin/${OSXCROSS_HOST}-ranlib" CACHE FILEPATH "ranlib")
|
||||
set(CMAKE_INSTALL_NAME_TOOL "${OSXCROSS_TARGET_DIR}/bin/${OSXCROSS_HOST}-install_name_tool" CACHE FILEPATH "install_name_tool")
|
||||
|
||||
set(ENV{PKG_CONFIG_LIBDIR} "${OSXCROSS_TARGET_DIR}/macports/pkgs/opt/local/lib/pkgconfig")
|
||||
set(ENV{PKG_CONFIG_SYSROOT_DIR} "${OSXCROSS_TARGET_DIR}/macports/pkgs")
|
34
cmake/i386-apple-darwin17.cmake
Normal file
34
cmake/i386-apple-darwin17.cmake
Normal file
|
@ -0,0 +1,34 @@
|
|||
#
|
||||
# Kangaroo Punch Toolchains
|
||||
# Copyright 2023-2024 Scott Duensing <scott@kangaroopunch.com>
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the “Software”), to
|
||||
# deal in the Software without restriction, including without limitation the
|
||||
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
# sell copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in
|
||||
# all copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
# IN THE SOFTWARE.
|
||||
#
|
||||
|
||||
|
||||
set(OSXCROSS_HOST i386-apple-darwin17)
|
||||
set(CMAKE_SYSTEM_PROCESSOR i386)
|
||||
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/apple-darwin-common.cmake)
|
||||
|
||||
set(CMAKE_C_FLAGS -m32)
|
||||
set(CMAKE_CXX_FLAGS -m32)
|
||||
|
||||
set(KANGAROO_OS macos)
|
||||
set(KANGAROO_ARCH x86)
|
34
cmake/i686-linux-gnu.cmake
Normal file
34
cmake/i686-linux-gnu.cmake
Normal file
|
@ -0,0 +1,34 @@
|
|||
#
|
||||
# Kangaroo Punch Toolchains
|
||||
# Copyright 2023-2024 Scott Duensing <scott@kangaroopunch.com>
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the “Software”), to
|
||||
# deal in the Software without restriction, including without limitation the
|
||||
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
# sell copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in
|
||||
# all copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
# IN THE SOFTWARE.
|
||||
#
|
||||
|
||||
|
||||
set(CMAKE_SYSTEM_NAME Linux)
|
||||
set(CMAKE_SYSTEM_PROCESSOR i686)
|
||||
|
||||
set(CMAKE_C_COMPILER i686-linux-gnu-gcc)
|
||||
set(CMAKE_C_FLAGS -m32)
|
||||
set(CMAKE_CXX_COMPILER i686-linux-gnu-g++)
|
||||
set(CMAKE_CXX_FLAGS -m32)
|
||||
|
||||
set(KANGAROO_OS linux)
|
||||
set(KANGAROO_ARCH x86)
|
39
cmake/i686-w64-mingw32.cmake
Normal file
39
cmake/i686-w64-mingw32.cmake
Normal file
|
@ -0,0 +1,39 @@
|
|||
#
|
||||
# Kangaroo Punch Toolchains
|
||||
# Copyright 2023-2024 Scott Duensing <scott@kangaroopunch.com>
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the “Software”), to
|
||||
# deal in the Software without restriction, including without limitation the
|
||||
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
# sell copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in
|
||||
# all copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
# IN THE SOFTWARE.
|
||||
#
|
||||
|
||||
|
||||
set(CMAKE_SYSTEM_NAME Windows)
|
||||
set(CMAKE_SYSTEM_PROCESSOR i686)
|
||||
|
||||
set(triple i686-w64-mingw32)
|
||||
|
||||
set(CMAKE_C_COMPILER i686-w64-mingw32-gcc-10-posix)
|
||||
set(CMAKE_C_COMPILER_TARGET ${triple})
|
||||
set(CMAKE_CXX_COMPILER i686-w64-mingw32-c++-posix)
|
||||
set(CMAKE_CXX_COMPILER_TARGET ${triple})
|
||||
|
||||
set(CMAKE_C_FLAGS -m32)
|
||||
set(CMAKE_CXX_FLAGS -m32)
|
||||
|
||||
set(KANGAROO_OS windows)
|
||||
set(KANGAROO_ARCH x86)
|
31
cmake/x86_64-apple-darwin17.cmake
Normal file
31
cmake/x86_64-apple-darwin17.cmake
Normal file
|
@ -0,0 +1,31 @@
|
|||
#
|
||||
# Kangaroo Punch Toolchains
|
||||
# Copyright 2023-2024 Scott Duensing <scott@kangaroopunch.com>
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the “Software”), to
|
||||
# deal in the Software without restriction, including without limitation the
|
||||
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
# sell copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in
|
||||
# all copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
# IN THE SOFTWARE.
|
||||
#
|
||||
|
||||
|
||||
set(OSXCROSS_HOST x86_64-apple-darwin17)
|
||||
set(CMAKE_SYSTEM_PROCESSOR x86_64)
|
||||
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/apple-darwin-common.cmake)
|
||||
|
||||
set(KANGAROO_OS macos)
|
||||
set(KANGAROO_ARCH x86_64)
|
29
cmake/x86_64-linux-gnu.cmake
Normal file
29
cmake/x86_64-linux-gnu.cmake
Normal file
|
@ -0,0 +1,29 @@
|
|||
#
|
||||
# Kangaroo Punch Toolchains
|
||||
# Copyright 2023-2024 Scott Duensing <scott@kangaroopunch.com>
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the “Software”), to
|
||||
# deal in the Software without restriction, including without limitation the
|
||||
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
# sell copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in
|
||||
# all copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
# IN THE SOFTWARE.
|
||||
#
|
||||
|
||||
|
||||
set(CMAKE_SYSTEM_NAME Linux)
|
||||
set(CMAKE_SYSTEM_PROCESSOR x86_64)
|
||||
|
||||
set(KANGAROO_OS linux)
|
||||
set(KANGAROO_ARCH x86_64)
|
36
cmake/x86_64-w64-mingw32.cmake
Normal file
36
cmake/x86_64-w64-mingw32.cmake
Normal file
|
@ -0,0 +1,36 @@
|
|||
#
|
||||
# Kangaroo Punch Toolchains
|
||||
# Copyright 2023-2024 Scott Duensing <scott@kangaroopunch.com>
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the “Software”), to
|
||||
# deal in the Software without restriction, including without limitation the
|
||||
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
# sell copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in
|
||||
# all copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
# IN THE SOFTWARE.
|
||||
#
|
||||
|
||||
|
||||
set(CMAKE_SYSTEM_NAME Windows)
|
||||
set(CMAKE_SYSTEM_PROCESSOR x86_64)
|
||||
|
||||
set(triple x86_64-w64-mingw32)
|
||||
|
||||
set(CMAKE_C_COMPILER x86_64-w64-mingw32-gcc-10-posix)
|
||||
set(CMAKE_C_COMPILER_TARGET ${triple})
|
||||
set(CMAKE_CXX_COMPILER x86_64-w64-mingw32-c++-posix)
|
||||
set(CMAKE_CXX_COMPILER_TARGET ${triple})
|
||||
|
||||
set(KANGAROO_OS windows)
|
||||
set(KANGAROO_ARCH x86_64)
|
23
install.sh
23
install.sh
|
@ -2,7 +2,8 @@
|
|||
|
||||
|
||||
#
|
||||
# Copyright 2023 Scott Duensing <scott@kangaroopunch.com>
|
||||
# Kangaroo Punch Toolchains
|
||||
# Copyright 2023-2024 Scott Duensing <scott@kangaroopunch.com>
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the “Software”), to
|
||||
|
@ -114,7 +115,7 @@ function install_armv6_pi() {
|
|||
|
||||
|
||||
function install_armv8_pi() {
|
||||
wget -O- ${PIURL}armv8-rpi3-linux-gnueabihf.tar.xz | tar xJ
|
||||
wget -O- ${PIURL}armv8-rpi3-linux-gnueabihf.tar.xz | tar xJ
|
||||
#***TODO*** sysroots
|
||||
}
|
||||
|
||||
|
@ -207,30 +208,30 @@ fi
|
|||
# Do they need help?
|
||||
if [[ ${HELP} -eq 1 ]]; then
|
||||
cat <<-HELP
|
||||
|
||||
|
||||
Kangaroo Punch Toolchain Installer
|
||||
http://skunkworks.kangaroopunch.com
|
||||
|
||||
|
||||
Usage: $0 [architecture] [platform]
|
||||
|
||||
|
||||
Where [architecture] and [platform] are one of:
|
||||
|
||||
|
||||
HELP
|
||||
for (( row=0; row<ROWS; row++ )); do
|
||||
printf ' %-10s %s\n' "${PLATFORMS[$((${COLS}*${row}))]}" "${PLATFORMS[$((${COLS}*${row}+1))]}"
|
||||
done
|
||||
cat <<-HELP
|
||||
|
||||
|
||||
If [architecture] and [platform] are both "all",
|
||||
everything will be installed.
|
||||
|
||||
|
||||
if [architecture] is "all", then all available
|
||||
architectures for the specified [platform] will
|
||||
be installed.
|
||||
|
||||
|
||||
NOTE: You should always install x86_64 linux
|
||||
before attempting to install other
|
||||
before attempting to install other
|
||||
toolchains.
|
||||
|
||||
|
||||
HELP
|
||||
fi
|
||||
|
|
Loading…
Add table
Reference in a new issue