diff --git a/CHANGELOG b/CHANGELOG index 83dc646..6cf56d1 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +* Mon May 24 2021 Matiss Treinis - 1.1.5.1 +- Support for Apple SoC + * Mon May 24 2021 Matiss Treinis - 1.1.5 - Bugfix - within aliased to shell in local context. diff --git a/CMakeLists.txt b/CMakeLists.txt index 7de0b3d..cda6ed3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.11.4) # IMPORTANT: updating version might require update in package dependencies at the end of this file. -set(KAFE_VERSION "1.1.5") +set(KAFE_VERSION "1.1.5.1") set(KAFE_SOVERSION "1.1") set(KAFE_VERSION_INT 11) set(KAFE_VERSION_DEP_NEXT_MAJOR "2.0.0") diff --git a/build-dist-macos.sh b/build-dist-macos.sh index d575c65..cfbe3e9 100755 --- a/build-dist-macos.sh +++ b/build-dist-macos.sh @@ -1,13 +1,46 @@ #!/usr/bin/env bash -set -xe # Build OSX from current directory. +echo "Building libkafe for macOS" + mkdir -p build/osx/ cd build/osx -export CC=/usr/local/opt/llvm/bin/clang -export CXX=/usr/local/opt/llvm/bin/clang++ +if [[ -z "${KAFE_CC}" ]]; then + if [ -f "/opt/homebrew/opt/llvm/bin/clang" ]; then + export CC=/opt/homebrew/opt/llvm/bin/clang + else + export CC=/usr/local/opt/llvm/bin/clang + fi + echo "Will look for C compiler at ${CC}" +else + echo "Using preset C compiler from environment - KAFE_CC - ${KAFE_CC}" + export CC=${KAFE_CC} +fi + +if [[ -z "${KAFE_CXX}" ]]; then + if [ -f "/opt/homebrew/opt/llvm/bin/clang++" ]; then + export CXX=/opt/homebrew/opt/llvm/bin/clang++ + else + export CXX=/usr/local/opt/llvm/bin/clang++ + fi + echo "Will look for C++ compiler at ${CXX}" +else + echo "Using preset C++ compiler from environment - KAFE_CXX - ${KAFE_CXX}" + export CXX=${KAFE_CXX} +fi +if [ ! -f "${CC}" ]; then + echo "Fail: C compiler not found. Declare explicitly using KAFE_CC environment variable" + exit 1 +fi + +if [ ! -f "${CXX}" ]; then + echo "Fail: C++ compiler not found. Declare explicitly using KAFE_CXX environment variable" + exit 1 +fi + +set -xe cmake ../.. make \ No newline at end of file diff --git a/cli/main.cpp b/cli/main.cpp index 482633c..d6cc053 100644 --- a/cli/main.cpp +++ b/cli/main.cpp @@ -37,8 +37,8 @@ extern char** environ; void loadEnvMap(map &envVals) { for (char **current = environ; *current; ++current) { - const string envVal = string(*current); - const ulong pos = envVal.find_first_of('='); + const auto envVal = string(*current); + const auto pos = envVal.find_first_of('='); pair p = pair( envVal.substr(0, pos), envVal.substr(pos + 1) diff --git a/libkafe/CMakeLists.txt b/libkafe/CMakeLists.txt index 42ec5a0..b613b6a 100644 --- a/libkafe/CMakeLists.txt +++ b/libkafe/CMakeLists.txt @@ -19,7 +19,7 @@ if (NOT UNIX AND NOT APPLE) endif () if(APPLE) - set(CMAKE_PREFIX_PATH "/usr/local/opt/libarchive/;/usr/local/opt/libssh/;/usr/local/opt/curl/;/usr/local/opt/libgit2/;/usr/local/opt/lua/") + set(CMAKE_PREFIX_PATH "/usr/local/opt/libarchive/;/usr/local/opt/libssh/;/usr/local/opt/curl/;/usr/local/opt/libgit2/;/usr/local/opt/lua/;/opt/homebrew/opt/libarchive/;/opt/homebrew/opt/libssh/;/opt/homebrew/opt/curl/;/opt/homebrew/opt/libgit2/;/opt/homebrew/opt/lua/") endif() if (CMAKE_BUILD_TYPE MATCHES Debug)