freebsd-skq/lib/libsqlite3/Makefile
Brandon Bergren bceb5a2c8d [PowerPC64LE] Pass our byte order to the sqlite3 build.
Due to the sqlite3 endian detection code preferring to check platform defines
instead of checking endian defines, it is necessary to manually set
the endianness on PowerPC64LE.

Unlike other bi-endian platforms, PowerPC64LE relies entirely on the
generic endianness macros like __BYTE_ORDER__ and has no platform-specific
define to denote little endian.

Add -DSQLITE_BYTEORDER=1234 to the CFLAGS when building libsqlite3 on
powerpc64le.

Fixes runtime operation of sqlite on PowerPC64LE.

Sponsored by:	Tag1 Consulting, Inc.
2020-09-23 02:17:44 +00:00

43 lines
784 B
Makefile

# $FreeBSD$
PACKAGE=lib${LIB}
PRIVATELIB= yes
LIB= sqlite3
SHLIB_MAJOR?= 0
LIBADD+= pthread
SRCS= sqlite3.c
INCS= sqlite3.h sqlite3ext.h
SQLITE= ${SRCTOP}/contrib/sqlite3
.PATH: ${SQLITE}
WARNS?= 3
CFLAGS+= -I${SQLITE} \
-DUSE_PREAD=1 \
-DSTDC_HEADERS=1 \
-DHAVE_SYS_TYPES_H=1 \
-DHAVE_SYS_STAT_H=1 \
-DHAVE_STDLIB_H=1 \
-DHAVE_STRING_H=1 \
-DHAVE_MEMORY_H=1 \
-DHAVE_STRINGS_H=1 \
-DHAVE_INTTYPES_H=1 \
-DHAVE_STDINT_H=1 \
-DHAVE_UNISTD_H=1 \
-DHAVE_DLFCN_H=1 \
-DHAVE_USLEEP=1 \
-DHAVE_LOCALTIME_R=1 \
-DHAVE_GMTIME_R=1 \
-DHAVE_DECL_STRERROR_R=1 \
-DHAVE_STRERROR_R=1 \
-DHAVE_POSIX_FALLOCATE=1 \
-D_REENTRANT=1 \
-DSQLITE_THREADSAFE=1
.if ${MACHINE_ARCH} == "powerpc64le"
CFLAGS+= -DSQLITE_BYTEORDER=1234
.endif
.include <bsd.lib.mk>