Merge pull request #657 from MrChromebox/fix-librem-hotp

libremkey-hotp-verification: toolchain adjustments
This commit is contained in:
tlaurion 2020-01-28 17:31:45 -05:00 committed by GitHub
commit 497765038e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 4 deletions

View File

@ -16,4 +16,5 @@ libremkey-hotp-verification_output := \
libremkey-hotp-verification_configure := \ libremkey-hotp-verification_configure := \
INSTALL="$(INSTALL)" \ INSTALL="$(INSTALL)" \
CROSS="$(CROSS)" \
cmake -DCMAKE_TOOLCHAIN_FILE=./Toolchain-heads.cmake -DCMAKE_AR="$(CROSS)ar" . cmake -DCMAKE_TOOLCHAIN_FILE=./Toolchain-heads.cmake -DCMAKE_AR="$(CROSS)ar" .

View File

@ -1,15 +1,24 @@
--- nitrokey-hotp-verification-a/Toolchain-heads.cmake 2018-05-22 09:55:46.907209235 -0700 --- nitrokey-hotp-verification-a/Toolchain-heads.cmake 2018-05-22 09:55:46.907209235 -0700
+++ nitrokey-hotp-verification-b/Toolchain-heads.cmake 2018-05-22 09:55:26.659371966 -0700 +++ nitrokey-hotp-verification-b/Toolchain-heads.cmake 2018-05-22 09:55:26.659371966 -0700
@@ -0,0 +1,18 @@ @@ -0,0 +1,27 @@
+SET(CMAKE_SYSTEM_NAME Linux) +SET(CMAKE_SYSTEM_NAME Linux)
+SET(CMAKE_SYSTEM_VERSION 1) +SET(CMAKE_SYSTEM_VERSION 1)
+ +
+# Specify the cross compiler +# Specify the cross compiler
+SET(CMAKE_C_COMPILER $ENV{INSTALL}/bin/musl-gcc) +SET(CMAKE_C_COMPILER $ENV{CROSS}gcc)
+SET(CMAKE_CXX_COMPILER $ENV{INSTALL}/bin/musl-gcc) +SET(CMAKE_CXX_COMPILER $ENV{CROSS}gcc)
+
+#sysroot location
+set(MYSYSROOT $ENV{INSTALL})
+
+# compiler/linker flags
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --sysroot=${MYSYSROOT}" CACHE INTERNAL "" FORCE)
+set(CMAKE_C_LINK_FLAGS "${CMAKE_C_LINK_FLAGS} --sysroot=${MYSYSROOT}" CACHE INTERNAL "" FORCE)
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --sysroot=${MYSYSROOT}" CACHE INTERNAL "" FORCE)
+set(CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} --sysroot=${MYSYSROOT}" CACHE INTERNAL "" FORCE)
+ +
+# Where is the target environment +# Where is the target environment
+SET(CMAKE_FIND_ROOT_PATH $ENV{INSTALL}) +SET(CMAKE_FIND_ROOT_PATH "${MYSYSROOT}")
+ +
+# Search for programs only in the build host directories +# Search for programs only in the build host directories
+SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) +SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)