[PPL-devel] [GIT] ppl/ppl(devel): Support modern versions of SWI-Prolog.

Roberto Bagnara roberto.bagnara at bugseng.com
Thu Jun 25 08:57:40 CEST 2020


Module: ppl/ppl
Branch: devel
Commit: e83a2d4eb3a22b436bd974899970f27fb873ffa4
URL:    http://www.cs.unipr.it/git/gitweb.cgi?p=ppl/ppl.git;a=commit;h=e83a2d4eb3a22b436bd974899970f27fb873ffa4

Author: Roberto Bagnara <roberto.bagnara at bugseng.com>
Date:   Wed Jun 24 20:20:45 2020 +0200

Support modern versions of SWI-Prolog.

---

 interfaces/Prolog/SWI/Makefile.am |    1 +
 interfaces/Prolog/SWI/ppl_pl.cc   |    2 +-
 m4/ac_check_swi_prolog.m4         |    2 ++
 3 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/interfaces/Prolog/SWI/Makefile.am b/interfaces/Prolog/SWI/Makefile.am
index d1a7dbe..bac949e 100644
--- a/interfaces/Prolog/SWI/Makefile.am
+++ b/interfaces/Prolog/SWI/Makefile.am
@@ -53,6 +53,7 @@ AM_CPPFLAGS = \
 -I$(top_srcdir)/interfaces/Prolog \
 -I$(top_buildir)/interfaces/Prolog \
 -I$(top_builddir)/src \
+$(SWI_PROLOG_DEFINE_OPTIONS) \
 $(SWI_PROLOG_INCLUDE_OPTIONS) \
 @extra_includes@
 
diff --git a/interfaces/Prolog/SWI/ppl_pl.cc b/interfaces/Prolog/SWI/ppl_pl.cc
index 4976402..de964bd 100644
--- a/interfaces/Prolog/SWI/ppl_pl.cc
+++ b/interfaces/Prolog/SWI/ppl_pl.cc
@@ -31,9 +31,9 @@ main(int argc, char **argv) {
   PL_action(PL_GMP_SET_ALLOC_FUNCTIONS, FALSE);
 #endif
 
+  putenv("SWI_HOME_DIR=" SWI_PROLOG_BASE);
   if (!PL_initialise(argc, argv))
     PL_halt(1);
-  PL_install_readline();
 
   install_libppl_swiprolog();
   int ret_val = PL_toplevel();
diff --git a/m4/ac_check_swi_prolog.m4 b/m4/ac_check_swi_prolog.m4
index a02313b..04c8309 100644
--- a/m4/ac_check_swi_prolog.m4
+++ b/m4/ac_check_swi_prolog.m4
@@ -59,6 +59,7 @@ then
     AC_PATH_PROG(swi_prolog_ld, plld$EXEEXT)
   fi
 
+  SWI_PROLOG_DEFINE_OPTIONS="-DSWI_PROLOG_BASE='\"${swi_prolog_base}\"'"
   # In Fedora, SWI-Prolog.h is installed only in /usr/include/pl, which,
   # IMHO, is a bug (https://bugzilla.redhat.com/show_bug.cgi?id=471071).
   SWI_PROLOG_INCLUDE_OPTIONS="-I${swi_prolog_base}/include -I/usr/include/pl"
@@ -96,6 +97,7 @@ main() {
   SWI_PROLOG_LD="$swi_prolog_ld"
   AC_SUBST(SWI_PROLOG)
   AC_SUBST(SWI_PROLOG_LD)
+  AC_SUBST(SWI_PROLOG_DEFINE_OPTIONS)
   AC_SUBST(SWI_PROLOG_INCLUDE_OPTIONS)
   AC_SUBST(SWI_PROLOG_LD_OPTIONS)
 fi




More information about the PPL-devel mailing list