Rebuild for pl 8.2.0. Add -pl82 patch.

This commit is contained in:
Jerry James 2020-05-28 10:22:28 -06:00
parent 366b485153
commit ad0895bd01
2 changed files with 210 additions and 7 deletions

196
ppl-pl82.patch Normal file
View File

@ -0,0 +1,196 @@
--- a/interfaces/Prolog/Ciao/ciao_cfli.hh
+++ b/interfaces/Prolog/Ciao/ciao_cfli.hh
@@ -296,7 +296,7 @@ Prolog_get_atom_name(Prolog_term_ref t,
The behavior is undefined if \p t is not a Prolog compound term.
*/
inline int
-Prolog_get_compound_name_arity(Prolog_term_ref t, Prolog_atom* ap, int* ip) {
+Prolog_get_compound_name_arity(Prolog_term_ref t, Prolog_atom* ap, size_t* ip) {
assert(Prolog_is_compound(t));
*ap = ciao_structure_name(t);
*ip = ciao_structure_arity(t);
--- a/interfaces/Prolog/GNU/gprolog_cfli.hh
+++ b/interfaces/Prolog/GNU/gprolog_cfli.hh
@@ -420,9 +420,11 @@ Prolog_get_atom_name(Prolog_term_ref t,
The behavior is undefined if \p t is not a Prolog compound term.
*/
inline int
-Prolog_get_compound_name_arity(Prolog_term_ref t, Prolog_atom* ap, int* ip) {
+Prolog_get_compound_name_arity(Prolog_term_ref t, Prolog_atom* ap, size_t* ip) {
+ int i;
assert(Prolog_is_compound(t));
- Rd_Compound_Check(t, ap, ip);
+ Rd_Compound_Check(t, ap, &i);
+ *ip = (size_t)i;
return 1;
}
--- a/interfaces/Prolog/ppl_interface_generator_prolog_cc_code.m4
+++ b/interfaces/Prolog/ppl_interface_generator_prolog_cc_code.m4
@@ -1934,7 +1934,7 @@ m4_define(`ppl_@CLASS@_map_space_dimensi
while (Prolog_is_cons(t_pfunc)) {
Prolog_get_cons(t_pfunc, t_pair, t_pfunc);
Prolog_atom functor;
- int arity;
+ size_t arity;
Prolog_get_compound_name_arity(t_pair, &functor, &arity);
if (arity != 2 || functor != a_minus)
return PROLOG_FAILURE;
--- a/interfaces/Prolog/ppl_prolog_common.cc
+++ b/interfaces/Prolog/ppl_prolog_common.cc
@@ -937,7 +937,7 @@ build_linear_expression(Prolog_term_ref
return Linear_Expression(integer_term_to_Coefficient(t));
else if (Prolog_is_compound(t)) {
Prolog_atom functor;
- int arity;
+ size_t arity;
Prolog_get_compound_name_arity(t, &functor, &arity);
switch (arity) {
case 1:
@@ -1000,7 +1000,7 @@ Constraint
build_constraint(Prolog_term_ref t, const char* where) {
if (Prolog_is_compound(t)) {
Prolog_atom functor;
- int arity;
+ size_t arity;
Prolog_get_compound_name_arity(t, &functor, &arity);
if (arity == 2) {
Prolog_term_ref arg1 = Prolog_new_term_ref();
@@ -1073,7 +1073,7 @@ Congruence
build_congruence(Prolog_term_ref t, const char* where) {
if (Prolog_is_compound(t)) {
Prolog_atom functor;
- int arity;
+ size_t arity;
Prolog_get_compound_name_arity(t, &functor, &arity);
if (arity == 2) {
Prolog_term_ref arg1 = Prolog_new_term_ref();
@@ -1084,7 +1084,7 @@ build_congruence(Prolog_term_ref t, cons
// /
if (Prolog_is_integer(arg2)) {
Prolog_atom functor1;
- int arity1;
+ size_t arity1;
Prolog_get_compound_name_arity(arg1, &functor1, &arity1);
if (arity1 == 2) {
if (functor1 == a_is_congruent_to) {
@@ -1137,7 +1137,7 @@ Generator
build_generator(Prolog_term_ref t, const char* where) {
if (Prolog_is_compound(t)) {
Prolog_atom functor;
- int arity;
+ size_t arity;
Prolog_get_compound_name_arity(t, &functor, &arity);
if (arity == 1) {
Prolog_term_ref arg = Prolog_new_term_ref();
@@ -1174,7 +1174,7 @@ Grid_Generator
build_grid_generator(Prolog_term_ref t, const char* where) {
if (Prolog_is_compound(t)) {
Prolog_atom functor;
- int arity;
+ size_t arity;
Prolog_get_compound_name_arity(t, &functor, &arity);
if (arity == 1) {
Prolog_term_ref arg = Prolog_new_term_ref();
@@ -1406,7 +1406,7 @@ Variable
term_to_Variable(Prolog_term_ref t, const char* where) {
if (Prolog_is_compound(t)) {
Prolog_atom functor;
- int arity;
+ size_t arity;
Prolog_get_compound_name_arity(t, &functor, &arity);
if (functor == a_dollar_VAR && arity == 1) {
Prolog_term_ref arg = Prolog_new_term_ref();
@@ -1554,7 +1554,7 @@ term_to_boundary(Prolog_term_ref t_b, Bo
return false;
Prolog_atom functor;
- int arity;
+ size_t arity;
Prolog_get_compound_name_arity(t_b, &functor, &arity);
// A boundary term is either of the form c(Limit) or o(Limit).
--- a/interfaces/Prolog/SICStus/sicstus_cfli.h
+++ b/interfaces/Prolog/SICStus/sicstus_cfli.h
@@ -134,7 +134,7 @@ Prolog_get_atom_name(Prolog_term_ref t,
PCFLI_DECLSPEC int
Prolog_get_compound_name_arity(Prolog_term_ref t,
- Prolog_atom& name, int& arity);
+ Prolog_atom& name, size_t& arity);
PCFLI_DECLSPEC int
Prolog_get_arg(int i, Prolog_term_ref t, Prolog_term_ref a);
--- a/interfaces/Prolog/SICStus/sicstus_cfli.ic
+++ b/interfaces/Prolog/SICStus/sicstus_cfli.ic
@@ -262,9 +262,12 @@ Prolog_get_atom_name(Prolog_term_ref t,
The behavior is undefined if \p t is not a Prolog compound term.
*/
PCFLI_EXTERN_INLINE int
-Prolog_get_compound_name_arity(Prolog_term_ref t, Prolog_atom* ap, int* ip) {
+Prolog_get_compound_name_arity(Prolog_term_ref t, Prolog_atom* ap, size_t* ip) {
+ int i, ret;
assert(Prolog_is_compound(t));
- return SP_get_functor(t, ap, ip);
+ ret = SP_get_functor(t, ap, &i);
+ *ip = i;
+ return ret;
}
/*!
--- a/interfaces/Prolog/SWI/swi_cfli.hh
+++ b/interfaces/Prolog/SWI/swi_cfli.hh
@@ -346,7 +346,7 @@ Prolog_get_atom_name(Prolog_term_ref t,
The behavior is undefined if \p t is not a Prolog compound term.
*/
inline int
-Prolog_get_compound_name_arity(Prolog_term_ref t, Prolog_atom* ap, int* ip) {
+Prolog_get_compound_name_arity(Prolog_term_ref t, Prolog_atom* ap, size_t* ip) {
assert(Prolog_is_compound(t));
return PL_get_name_arity(t, ap, ip);
}
--- a/interfaces/Prolog/XSB/xsb_cfli.hh
+++ b/interfaces/Prolog/XSB/xsb_cfli.hh
@@ -314,10 +314,10 @@ Prolog_get_atom_name(Prolog_term_ref t,
The behavior is undefined if \p t is not a Prolog compound term.
*/
inline int
-Prolog_get_compound_name_arity(Prolog_term_ref t, Prolog_atom* ap, int* ip) {
+Prolog_get_compound_name_arity(Prolog_term_ref t, Prolog_atom* ap, size_t* ip) {
assert(Prolog_is_compound(t));
*ap = p2c_functor(t);
- *ip = p2c_arity(t);
+ *ip = (size_t)p2c_arity(t);
return 1;
}
--- a/interfaces/Prolog/YAP/yap_cfli.hh
+++ b/interfaces/Prolog/YAP/yap_cfli.hh
@@ -313,7 +313,7 @@ Prolog_get_atom_name(Prolog_term_ref t,
The behavior is undefined if \p t is not a Prolog compound term.
*/
inline int
-Prolog_get_compound_name_arity(Prolog_term_ref t, Prolog_atom* ap, int* ip) {
+Prolog_get_compound_name_arity(Prolog_term_ref t, Prolog_atom* ap, size_t* ip) {
assert(Prolog_is_compound(t));
YAP_Functor f = YAP_FunctorOfTerm(t);
*ap = YAP_NameOfFunctor(f);
--- a/m4/ac_check_swi_prolog.m4
+++ b/m4/ac_check_swi_prolog.m4
@@ -45,11 +45,11 @@ then
fi
if test x$swi_prolog != x
then
- swi_prolog_base=`$swi_prolog -dump-runtime-variables | grep PLBASE= | sed 's/PLBASE="\([[a-z]]:\)\{0,1\}\(.*\)";.*/\2/'`
- swi_prolog_version=`$swi_prolog -dump-runtime-variables | grep PLVERSION= | sed 's/PLVERSION="\(.*\)";.*/\1/'`
- swi_prolog_arch=`$swi_prolog -dump-runtime-variables | grep PLARCH= | sed 's/PLARCH="\(.*\)";.*/\1/'`
- swi_prolog_libs=`$swi_prolog -dump-runtime-variables | grep PLLIBS= | sed 's/PLLIBS="\(.*\)";.*/\1/'`
- swi_prolog_lib=`$swi_prolog -dump-runtime-variables | grep PLLIB= | sed 's/PLLIB="\(.*\)";.*/\1/'`
+ swi_prolog_base=`$swi_prolog --dump-runtime-variables | grep PLBASE= | sed 's/PLBASE="\([[a-z]]:\)\{0,1\}\(.*\)";.*/\2/'`
+ swi_prolog_version=`$swi_prolog --dump-runtime-variables | grep PLVERSION= | sed 's/PLVERSION="\(.*\)";.*/\1/'`
+ swi_prolog_arch=`$swi_prolog --dump-runtime-variables | grep PLARCH= | sed 's/PLARCH="\(.*\)";.*/\1/'`
+ swi_prolog_libs=`$swi_prolog --dump-runtime-variables | grep PLLIBS= | sed 's/PLLIBS="\(.*\)";.*/\1/'`
+ swi_prolog_lib=`$swi_prolog --dump-runtime-variables | grep PLLIB= | sed 's/PLLIB="\(.*\)";.*/\1/'`
dnl Additional version checks could be inserted here, if necessary.

View File

@ -1,13 +1,17 @@
Name: ppl
Version: 1.2
Release: 15%{?dist}
Release: 16%{?dist}
Summary: The Parma Polyhedra Library: a library of numerical abstractions
License: GPLv3+
URL: http://www.bugseng.com/ppl
Source0: http://www.bugseng.com/products/ppl/download/ftp/releases/%{version}/%{name}-%{version}.tar.bz2
Source1: ppl.hh
Source2: ppl_c.h
Patch0: configure.patch
# Fix configure test compromised by LTO
Patch0: configure.patch
# Adapt to swipl 8.2.x
Patch1: %{name}-pl82.patch
BuildRequires: gcc-c++
BuildRequires: automake
BuildRequires: libtool
@ -127,14 +131,13 @@ Install this package if you want to program with the PPL.
%prep
%autosetup -p1
# Adapt to SWI Prolog 8.x
sed -i 's/-dump-runtime-variables/-&/g' configure
# Fix detection of C++11 features
sed -i 's,== 201103L,>= 201103L,g' configure
sed -i 's,== 201103L,>= 201103L,g' m4/ac_check_cxx11.m4
# Regenerate configure
autoreconf -fiv
%build
autoreconf -fiv
CPPFLAGS="-I`swipl --dump-runtime-variables | grep PLBASE= | sed 's/PLBASE="\(.*\)";/\1/'`/include"
# This is the explicit list of arches gprolog supports
%ifarch x86_64 %{ix86} ppc alpha
@ -278,6 +281,10 @@ mv \
%doc %{_datadir}/doc/%{name}/ppl-user-prolog-interface-%{version}.ps.gz
%changelog
* Thu May 28 2020 Jerry James <loganjerry@gmail.com> - 1.2-16
- Rebuild for pl 8.2.0
- Add -pl82 patch
* Tue May 26 2020 Jeff Law <law@redhat.com> - 1.2-15
- Fix configure test compromised by LTO. autoreconf after
before configuring. Depend on automake and libtool.