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>
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")
SET(VERSION "unknown")
ENDIF()
+TEST_BIG_ENDIAN(WORDS_BIGENDIAN)
+
ADD_DEFINITIONS(-Os -Wall --std=gnu99 -g3 -Wmissing-declarations
-DDATADIR="/usr/share"
-DOPKGETCDIR="/etc"
ADD_DEFINITIONS(-DHAVE_USIGN)
ENDIF()
+IF(WORDS_BIGENDIAN)
+ ADD_DEFINITIONS(-DWORDS_BIGENDIAN)
+ENDIF()
+
ADD_SUBDIRECTORY(libbb)
ADD_SUBDIRECTORY(libopkg)
ADD_SUBDIRECTORY(src)