Monday, May 29, 2017

[update and improvement] gprolog

While trying to get everything to work with clang, I've stumbled on
gprolog.

Here is an update to 1.4.4. It doesn't make it work with clang either,
but at least it's newer (I peeked: FreeBSD does compile gprolog with gcc)

The most important improvement in the port is doing OpenBSD detection
in configure, which allows CFLAGS_MACHINE to contain -fno-pie -nopie,
thus leading to glpc working "out of the box" and killing a number
of Makefile patches.

Okay ?

Index: Makefile
===================================================================
RCS file: /cvs/ports/lang/gprolog/Makefile,v
retrieving revision 1.16
diff -u -p -r1.16 Makefile
--- Makefile 8 Jan 2014 11:54:12 -0000 1.16
+++ Makefile 29 May 2017 13:39:39 -0000
@@ -4,8 +4,7 @@ ONLY_FOR_ARCHS= amd64 i386

COMMENT= Prolog compiler

-DISTNAME= gprolog-1.3.1
-REVISION= 0
+DISTNAME= gprolog-1.4.4
CATEGORIES= lang

HOMEPAGE= http://www.gprolog.org/
@@ -19,7 +18,7 @@ WANTLIB= c m

MASTER_SITES= ${MASTER_SITE_GNU:=gprolog/}

-AUTOCONF_VERSION= 2.61
+AUTOCONF_VERSION= 2.68
CONFIGURE_STYLE= autoconf dest no-autoheader


@@ -31,7 +30,7 @@ CONFIGURE_ARGS+= --with-install-dir='${P
--with-examples-dir='${PREFIX}/share/examples/gprolog' \
--with-html-dir='${PREFIX}/share/doc/gprolog/html' \
--with-doc-dir='${PREFIX}/share/doc/gprolog' \
- --with-c-flags="${CFLAGS} -fno-pie -nopie"
+ --with-c-flags="${CFLAGS}"

WRKDIST= ${WRKDIR}/${DISTNAME}/src

Index: distinfo
===================================================================
RCS file: /cvs/ports/lang/gprolog/distinfo,v
retrieving revision 1.5
diff -u -p -r1.5 distinfo
--- distinfo 8 Jan 2014 11:54:12 -0000 1.5
+++ distinfo 29 May 2017 13:39:39 -0000
@@ -1,2 +1,2 @@
-SHA256 (gprolog-1.3.1.tar.gz) = PDMVm50jRkegbniHDBSgUY1qKl+F25BjYHd/6z2YwxY=
-SIZE (gprolog-1.3.1.tar.gz) = 2949369
+SHA256 (gprolog-1.4.4.tar.gz) = GMDpZEszr9TdPN8p+UwJmtgg1l4MmdpUlbGuQ7TysY4=
+SIZE (gprolog-1.4.4.tar.gz) = 3538152
Index: patches/patch-EnginePl_machine_h
===================================================================
RCS file: /cvs/ports/lang/gprolog/patches/patch-EnginePl_machine_h,v
retrieving revision 1.1
diff -u -p -r1.1 patch-EnginePl_machine_h
--- patches/patch-EnginePl_machine_h 8 Jan 2014 11:54:12 -0000 1.1
+++ patches/patch-EnginePl_machine_h 29 May 2017 13:39:39 -0000
@@ -13,9 +13,10 @@ compilation failed
*** Error 1 in /tmp_ports/gprolog-1.3.1/gprolog-1.3.1/src (Makefile:47 'all')
===

---- EnginePl/machine.h.orig Wed Jan 8 04:11:21 2014
-+++ EnginePl/machine.h Wed Jan 8 04:12:30 2014
-@@ -110,7 +110,7 @@ void M_Check_Magic_Words(void); /* not compiled if not
+Index: EnginePl/machine.h
+--- EnginePl/machine.h.orig
++++ EnginePl/machine.h
+@@ -124,7 +124,7 @@ void M_Check_Magic_Words(void); /* not compiled if not
# define M_USED_REGS {"$9", "$10", "$11", "$12", "$13", "$14", 0}

/* on M_ix86_darwin : %ebx is used by gcc for pic base */
Index: patches/patch-EnginePl_obj_chain_h
===================================================================
RCS file: /cvs/ports/lang/gprolog/patches/patch-EnginePl_obj_chain_h,v
retrieving revision 1.1
diff -u -p -r1.1 patch-EnginePl_obj_chain_h
--- patches/patch-EnginePl_obj_chain_h 27 Dec 2009 19:30:21 -0000 1.1
+++ patches/patch-EnginePl_obj_chain_h 29 May 2017 13:39:39 -0000
@@ -1,11 +1,13 @@
$OpenBSD: patch-EnginePl_obj_chain_h,v 1.1 2009/12/27 19:30:21 jasper Exp $
---- EnginePl/obj_chain.h.orig Wed May 9 03:20:35 2007
-+++ EnginePl/obj_chain.h Wed May 9 03:21:54 2007
-@@ -84,6 +84,6 @@ static long obj_chain_start = (long) OBJ_CTOR;
+Index: EnginePl/obj_chain.h
+--- EnginePl/obj_chain.h.orig
++++ EnginePl/obj_chain.h
+@@ -95,7 +95,7 @@ static PlLong obj_chain_start = (PlLong) OBJ_CTOR;



--#if defined(_MSC_VER) || defined(M_ix86_darwin)
-+#if defined(_MSC_VER) || defined(M_ix86_darwin) || defined(__OpenBSD__)
+-#if (defined(_MSC_VER) || defined(M_darwin)) && !defined(OBJ_CHAIN_REVERSE_ORDER)
++#if (defined(_MSC_VER) || defined(M_darwin) || defined(__OpenBSD__)) && !defined(OBJ_CHAIN_REVERSE_ORDER)
#define OBJ_CHAIN_REVERSE_ORDER

No comments:

Post a Comment