Add swi-prolog in versions 6.0.2 and 6.2.0,

patches and bep-files provided by 'munchausen', thanks!
This commit is contained in:
Oliver Tappe
2012-08-26 12:01:49 +00:00
parent 96f6e696f6
commit 2c278ef7d2
5 changed files with 198 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
The SWI-Prolog Prolog libraries
Lacking a satisfactory technical solution to handle article 6 of the LGPL, this license cannot be used for the Prolog source code that is part of the SWI-Prolog system (both libraries and kernel code). This situation is comparable to libgcc, the runtime library used with the GNU C-compiler. Therefore, we use the same proven license terms as this library. The libgcc license is the GPL, accompanied with a special exception. Below we rephrased this exception adjusted to our needs:
As a special exception, if you link this library with other files, compiled with a Free Software compiler, to produce an executable, this library does not by itself cause the resulting executable to be covered by the GNU General Public License. This exception does not however invalidate any other reasons why the executable file might be covered by the GNU General Public License.

View File

@@ -0,0 +1,68 @@
diff -Naur pl-6.0.2/src/configure.in pl-6.0.2-haiku/src/configure.in
--- pl-6.0.2/src/configure.in 2012-03-04 13:12:01.001835008 +0000
+++ pl-6.0.2-haiku/src/configure.in 2012-08-20 21:39:21.649330688 +0100
@@ -689,6 +689,10 @@
AC_DEFINE(_THREAD_SAFE, 1,
[Required in FreeBSD for compiling thread-safe code])
;;
+ *haiku*)
+ pthread_ok=true
+ CFLAGS="$CFLAGS -lroot"
+ ;;
*-win32|*-win64)
pthread_ok=true
AC_CHECK_LIB(pthreadGC2, pthread_create)
diff -Naur pl-6.0.2/src/os/pl-files.c pl-6.0.2-haiku/src/os/pl-files.c
--- pl-6.0.2/src/os/pl-files.c 2012-03-04 13:12:01.011272192 +0000
+++ pl-6.0.2-haiku/src/os/pl-files.c 2012-08-23 14:45:48.981204992 +0100
@@ -239,7 +239,7 @@
return TRUE;
}
-#ifdef __unix__ /* doesn't work on most not Unix's */
+#if defined(__unix__) || defined(__HAIKU__) /* doesn't work on most not Unix's */
{ statstruct buf1;
statstruct buf2;
char tmp[MAXPATHLEN];
diff -Naur pl-6.0.2/src/os/pl-os.c pl-6.0.2-haiku/src/os/pl-os.c
--- pl-6.0.2/src/os/pl-os.c 2012-03-04 13:12:01.011796480 +0000
+++ pl-6.0.2-haiku/src/os/pl-os.c 2012-08-23 16:02:11.794034176 +0100
@@ -590,7 +590,7 @@
}
retry:
-#ifdef __unix__
+#if defined(__unix__) || defined(__HAIKU__)
{ static int MTOK_temp_counter = 0;
const char *sep = id[0] ? "_" : "";
@@ -732,7 +732,7 @@
}
#endif /* O_HPFS */
-#ifdef __unix__
+#if defined(__unix__) || defined(__HAIKU__)
char *
PrologPath(const char *p, char *buf, size_t len)
{ strncpy(buf, p, len);
@@ -2436,7 +2436,7 @@
return strcpy(buffer, file ? file : buf);
}
-#ifdef __unix__
+#if defined(__unix__) || defined(__HAIKU__)
static char *
okToExec(const char *s)
{ statstruct stbuff;
diff -Naur pl-6.0.2/src/pl-term.c pl-6.0.2-haiku/src/pl-term.c
--- pl-6.0.2/src/pl-term.c 2012-03-04 13:12:01.023592960 +0000
+++ pl-6.0.2-haiku/src/pl-term.c 2012-08-08 20:03:23.111673344 +0100
@@ -296,7 +296,7 @@
term_t r = A1;
term_t c = A2;
-#ifdef __unix__
+#if defined(__unix__) || defined(__HAIKU__)
int iorval;
#ifdef TIOCGSIZE

View File

@@ -0,0 +1,67 @@
diff -Naur pl-6.2.0/src/configure.in pl-6.2.0-haiku/src/configure.in
--- pl-6.2.0/src/configure.in 2012-08-21 13:12:53.016777216 +0100
+++ pl-6.2.0-haiku/src/configure.in 2012-08-23 17:06:25.987758592 +0100
@@ -728,6 +728,9 @@
AC_DEFINE(_THREAD_SAFE, 1,
[Required in FreeBSD for compiling thread-safe code])
;;
+ *-haiku*)
+ pthread_ok=true
+ ;;
*-win32|*-win64)
pthread_ok=true
AC_CHECK_LIB(pthreadGC2, pthread_create)
diff -Naur pl-6.2.0/src/os/pl-files.c pl-6.2.0-haiku/src/os/pl-files.c
--- pl-6.2.0/src/os/pl-files.c 2012-08-21 13:12:53.026214400 +0100
+++ pl-6.2.0-haiku/src/os/pl-files.c 2012-08-23 17:07:04.695992320 +0100
@@ -302,7 +302,7 @@
return TRUE;
}
-#ifdef __unix__ /* doesn't work on most not Unix's */
+#if defined(__unix__) || defined(__HAIKU__) /* doesn't work on most not Unix's */
{ statstruct buf1;
statstruct buf2;
char tmp[MAXPATHLEN];
diff -Naur pl-6.2.0/src/os/pl-os.c pl-6.2.0-haiku/src/os/pl-os.c
--- pl-6.2.0/src/os/pl-os.c 2012-08-21 13:12:53.027000832 +0100
+++ pl-6.2.0-haiku/src/os/pl-os.c 2012-08-23 17:09:14.962330624 +0100
@@ -601,7 +601,7 @@
}
retry:
-#ifdef __unix__
+#if defined(__unix__) || defined(__HAIKU__)
{ static int MTOK_temp_counter = 0;
const char *sep = id[0] ? "_" : "";
@@ -743,7 +743,7 @@
}
#endif /* O_HPFS */
-#ifdef __unix__
+#if defined(__unix__) || defined(__HAIKU__)
char *
PrologPath(const char *p, char *buf, size_t len)
{ strncpy(buf, p, len);
@@ -2507,7 +2507,7 @@
return strcpy(buffer, file ? file : buf);
}
-#ifdef __unix__
+#if defined(__unix__) || defined(__HAIKU__)
static char *
okToExec(const char *s)
{ statstruct stbuff;
diff -Naur pl-6.2.0/src/pl-term.c pl-6.2.0-haiku/src/pl-term.c
--- pl-6.2.0/src/pl-term.c 2012-08-21 13:12:53.038535168 +0100
+++ pl-6.2.0-haiku/src/pl-term.c 2012-08-23 17:09:57.306708480 +0100
@@ -296,7 +296,7 @@
term_t r = A1;
term_t c = A2;
-#ifdef __unix__
+#if defined(__unix__) || defined(__HAIKU__)
int iorval;
#ifdef TIOCGSIZE

View File

@@ -0,0 +1,29 @@
DESCRIPTION="SWI Prolog. Stable and free standard Prolog implementation"
HOMEPAGE="http://www.swi-prolog.org/"
SRC_URI="http://www.swi-prolog.org/download/stable/src/pl-6.0.2.tar.gz"
CHECKSUM_MD5="dcde1c50713317d0f5093dd2dedc1bd0"
REVISION="1"
STATUS_HAIKU="stable"
DEPEND="dev-libs/gmp >= 5.0.5
sys-libs/readline >= 6.2"
BUILD {
cd pl-6.0.2/src
libtoolize -fci
autoreconf
LDFLAGS=-L/boot/common/lib CFLAGS=-I/boot/common/include ./configure --prefix=$(finddir B_COMMON_DIRECTORY)
make
}
INSTALL {
cd pl-6.0.2/src
make install
}
TEST {
cd pl-6.0.2/src
make check
}
LICENSE="GNU LGPL v2.1
swi-prolog"
COPYRIGHT="Copyright (C): 1985-2010, University of Amsterdam, VU University Amsterdam"

View File

@@ -0,0 +1,29 @@
DESCRIPTION="SWI Prolog. Stable and free standard Prolog implementation"
HOMEPAGE="http://www.swi-prolog.org/"
SRC_URI="http://www.swi-prolog.org/download/stable/src/pl-6.2.0.tar.gz"
CHECKSUM_MD5="969ed2e00b7afc1537fbf19d667333c5"
REVISION="1"
STATUS_HAIKU="stable"
DEPEND="dev-libs/gmp >= 5.0.5
sys-libs/readline >= 6.2"
BUILD {
cd pl-6.2.0/src
libtoolize -fci
autoreconf
LDFLAGS=-L/boot/common/lib CFLAGS=-I/boot/common/include ./configure --prefix=$(finddir B_COMMON_DIRECTORY)
make
}
INSTALL {
cd pl-6.2.0/src
make install
}
TEST {
cd pl-6.2.0/src
make check
}
LICENSE="GNU LGPL v2.1
swi-prolog"
COPYRIGHT="Copyright (C): 1985-2012, University of Amsterdam, VU University Amsterdam"