diff options
| author | Jonas Gorski | 2017-11-18 11:30:11 +0000 |
|---|---|---|
| committer | Jonas Gorski | 2017-12-04 14:01:01 +0000 |
| commit | 468158f01ea0cb891f586936217f1a765fd207b7 (patch) | |
| tree | 0ca2857630d0ada28a0c8c1963be8b52b5a17e8b | |
| parent | 4bd8601ebd95c130e504cc724b0c5eb163050982 (diff) | |
| download | opkg-lede-468158f01ea0cb891f586936217f1a765fd207b7.tar.gz | |
libopkg: fix SHA256 calculation for big endian system
The SHA256 implementation relied on WORDS_BIGENDIAN being defined for
big endian systems, but this was broken since the switch to cmake,
causing wrong checksums on big endian systems like ar71xx.
Fix this by adding a cmake check for endianess similar to the one done
by the original autotools.
Fixes: e6e6c5a21634 ("build: add cmake build system")
Acked-by: Jo-Philipp Wich <jo@mein.io>
Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
| -rw-r--r-- | CMakeLists.txt | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 30a5d44..26230b3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,6 +2,8 @@ cmake_minimum_required(VERSION 2.6) PROJECT(opkg C) +INCLUDE(TestBigEndian) + SET(HOST_CPU "" CACHE STRING "Override Host CPU") SET(BUILD_CPU "" CACHE STRING "Override Host CPU") SET(LOCK_FILE "/var/lock/opkg.lock" CACHE STRING "Override lock file path") @@ -31,6 +33,8 @@ IF(NOT VERSION) SET(VERSION "unknown") ENDIF() +TEST_BIG_ENDIAN(WORDS_BIGENDIAN) + ADD_DEFINITIONS(-Os -Wall --std=gnu99 -g3 -Wmissing-declarations -DDATADIR="/usr/share" -DOPKGETCDIR="/etc" @@ -46,6 +50,10 @@ IF(ENABLE_USIGN) ADD_DEFINITIONS(-DHAVE_USIGN) ENDIF() +IF(WORDS_BIGENDIAN) + ADD_DEFINITIONS(-DWORDS_BIGENDIAN) +ENDIF() + ADD_SUBDIRECTORY(libbb) ADD_SUBDIRECTORY(libopkg) ADD_SUBDIRECTORY(src) |