Without defining LEVELDB_HAS_PORT_CONFIG_H port/port_config.h will not
be included:
https://github.com/google/leveldb/blob/master/port/port_stdcxx.h#L8
which breaks endian detection. Add the define to our memenv patch to fix
building with gcc < 5.
__has_include was added in gcc5: https://gcc.gnu.org/gcc-5/changes.html
Fixes:
http://autobuild.buildroot.net/results/4ac/
4ac8fbed79307326086ab294eba9e68cf208e6ac/
Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
+ # Used by port/port.h.
+ ${LEVELDB_PLATFORM_NAME}=1
+)
++if (NOT HAVE_CXX17_HAS_INCLUDE)
++ target_compile_definitions(memenv
++ PRIVATE
++ LEVELDB_HAS_PORT_CONFIG_H=1
++ )
++endif(NOT HAVE_CXX17_HAS_INCLUDE)
+target_include_directories(memenv
+ PUBLIC
+ $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>