mirror of
https://gitlab.com/buildroot.org/buildroot.git
synced 2026-08-09 17:03:35 -09:00
For change log since version 9.2.9, see: https://www.swi-prolog.org/ChangeLog?branch=stable&from=9.2.9&to=10.0.2 This new version can no longer build in the source tree. Therefore, this commit adds SWIPL_SUPPORTS_IN_SOURCE_BUILD = NO. Also, the target swipl needs the host-swipl binary. It is searched by the cmake script. This commit changes SWIPL_NATIVE_FRIEND variable to point to the out-of-source build directory. swipl has now a stricter ABI check of its prolog library bytecode compiled files, compared to its builtin expected ABI: https://github.com/SWI-Prolog/swipl/blob/V10.0.2/src/pl-init.c#L263 When cross-compiling, swipl is built on one side, and library files are built with the host-swipl. The ABI string of the host-swipl and target swipl must match. If not matching, swipl fail to start at runtime with the error: FATAL: could not find SWI-Prolog home Tried source: compiled in Found /usr/lib/swipl: ABI mismatch This ABI string includes a signature of builtin modules. See: https://github.com/SWI-Prolog/swipl/blob/V10.0.2/src/pl-init.c#L1653 https://github.com/SWI-Prolog/swipl/blob/V10.0.2/src/pl-ext.c#L330 The swipl ncurses support is made with one those builtin module. ncurses development files are likely present on host and likely not enabled or needed on target, hence producing a different ABI signature. For that reason, this commit disables ncurses on both the host and target. Signed-off-by: Julien Olivain <ju.o@free.fr> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
63 lines
1.7 KiB
Makefile
63 lines
1.7 KiB
Makefile
################################################################################
|
|
#
|
|
# swipl
|
|
#
|
|
################################################################################
|
|
|
|
SWIPL_VERSION = 10.0.2
|
|
SWIPL_SITE = https://www.swi-prolog.org/download/stable/src
|
|
SWIPL_LICENSE = BSD-2-Clause
|
|
SWIPL_LICENSE_FILES = LICENSE
|
|
|
|
SWIPL_SUPPORTS_IN_SOURCE_BUILD = NO
|
|
|
|
HOST_SWIPL_DEPENDENCIES = host-zlib
|
|
|
|
SWIPL_DEPENDENCIES = host-swipl zlib
|
|
|
|
# A host-swipl is needed to compile the target prolog boot
|
|
# boot.prl file.
|
|
HOST_SWIPL_CONF_OPTS = \
|
|
-DHAVE_CURSES_H=0 \
|
|
-DBUILD_PDF_DOCUMENTATION=OFF \
|
|
-DSWIPL_PACKAGES=OFF \
|
|
-DUSE_GMP=OFF \
|
|
-DUSE_TCMALLOC=OFF
|
|
|
|
# swipl uses cmake macros try_run() and check_c_source_runs(), which
|
|
# are not suitable for cross compilation. We add results in cache to
|
|
# avoid running those tests. The SWIPL_NATIVE_FRIEND variable, is
|
|
# meant to point to build directory of a host native swipl, rather
|
|
# than the binary itself. The Cmake macro will append "src/swipl" to
|
|
# the path set to this variable. Therefore, we cannot use the host
|
|
# "swipl" binary installed in $(HOST_DIR)/usr/bin.
|
|
SWIPL_CONF_OPTS = \
|
|
-DHAVE_CURSES_H=0 \
|
|
-DBUILD_PDF_DOCUMENTATION=OFF \
|
|
-DHAVE_WEAK_ATTRIBUTE=1 \
|
|
-DLLROUND_OK=1 \
|
|
-DMODF_OK=1 \
|
|
-DQSORT_R_GNU=1 \
|
|
-DSWIPL_NATIVE_FRIEND=$(HOST_SWIPL_BUILDDIR) \
|
|
-DSWIPL_PACKAGES=OFF \
|
|
-DUSE_TCMALLOC=OFF \
|
|
-DCMAKE_CXX_COMPILER=true
|
|
|
|
ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y)
|
|
SWIPL_CONF_OPTS += -DCMAKE_EXE_LINKER_FLAGS=-latomic
|
|
endif
|
|
|
|
ifeq ($(BR2_PACKAGE_GMP),y)
|
|
SWIPL_CONF_OPTS += -DUSE_GMP=ON
|
|
SWIPL_DEPENDENCIES += gmp
|
|
else
|
|
SWIPL_CONF_OPTS += -DUSE_GMP=OFF
|
|
endif
|
|
|
|
ifeq ($(BR2_PACKAGE_NCURSES),y)
|
|
SWIPL_DEPENDENCIES += ncurses
|
|
endif
|
|
|
|
$(eval $(cmake-package))
|
|
$(eval $(host-cmake-package))
|