diff --git a/cmake/aarch64-apple-darwin22.4.cmake b/cmake/aarch64-apple-darwin22.4.cmake new file mode 100644 index 0000000..eca9167 --- /dev/null +++ b/cmake/aarch64-apple-darwin22.4.cmake @@ -0,0 +1,31 @@ +# +# Kangaroo Punch Toolchains +# Copyright 2023-2024 Scott Duensing +# +# 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) diff --git a/cmake/apple-darwin-common.cmake b/cmake/apple-darwin-common.cmake new file mode 100644 index 0000000..9a11f72 --- /dev/null +++ b/cmake/apple-darwin-common.cmake @@ -0,0 +1,66 @@ +# +# Kangaroo Punch Toolchains +# Copyright 2023-2024 Scott Duensing +# +# 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") diff --git a/cmake/i386-apple-darwin17.cmake b/cmake/i386-apple-darwin17.cmake new file mode 100644 index 0000000..6f8c8c2 --- /dev/null +++ b/cmake/i386-apple-darwin17.cmake @@ -0,0 +1,34 @@ +# +# Kangaroo Punch Toolchains +# Copyright 2023-2024 Scott Duensing +# +# 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) diff --git a/cmake/i686-linux-gnu.cmake b/cmake/i686-linux-gnu.cmake new file mode 100644 index 0000000..743b137 --- /dev/null +++ b/cmake/i686-linux-gnu.cmake @@ -0,0 +1,34 @@ +# +# Kangaroo Punch Toolchains +# Copyright 2023-2024 Scott Duensing +# +# 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) diff --git a/cmake/i686-w64-mingw32.cmake b/cmake/i686-w64-mingw32.cmake new file mode 100644 index 0000000..967c962 --- /dev/null +++ b/cmake/i686-w64-mingw32.cmake @@ -0,0 +1,39 @@ +# +# Kangaroo Punch Toolchains +# Copyright 2023-2024 Scott Duensing +# +# 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) diff --git a/cmake/x86_64-apple-darwin17.cmake b/cmake/x86_64-apple-darwin17.cmake new file mode 100644 index 0000000..bbee7d5 --- /dev/null +++ b/cmake/x86_64-apple-darwin17.cmake @@ -0,0 +1,31 @@ +# +# Kangaroo Punch Toolchains +# Copyright 2023-2024 Scott Duensing +# +# 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) diff --git a/cmake/x86_64-linux-gnu.cmake b/cmake/x86_64-linux-gnu.cmake new file mode 100644 index 0000000..315382f --- /dev/null +++ b/cmake/x86_64-linux-gnu.cmake @@ -0,0 +1,29 @@ +# +# Kangaroo Punch Toolchains +# Copyright 2023-2024 Scott Duensing +# +# 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) diff --git a/cmake/x86_64-w64-mingw32.cmake b/cmake/x86_64-w64-mingw32.cmake new file mode 100644 index 0000000..d09dbdc --- /dev/null +++ b/cmake/x86_64-w64-mingw32.cmake @@ -0,0 +1,36 @@ +# +# Kangaroo Punch Toolchains +# Copyright 2023-2024 Scott Duensing +# +# 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) diff --git a/install.sh b/install.sh index 9bffcef..a55c19a 100755 --- a/install.sh +++ b/install.sh @@ -2,7 +2,8 @@ # -# Copyright 2023 Scott Duensing +# Kangaroo Punch Toolchains +# Copyright 2023-2024 Scott Duensing # # 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