aboutsummaryrefslogtreecommitdiffstats
path: root/lang
diff options
context:
space:
mode:
authorIon-Mihai Tetcu <itetcu@FreeBSD.org>2008-05-10 01:11:13 +0800
committerIon-Mihai Tetcu <itetcu@FreeBSD.org>2008-05-10 01:11:13 +0800
commit430838889b08d39c15f52756f11acd02cfbb26dc (patch)
tree77c2d8d92862a9b898f25f1e085b545964883940 /lang
parent395271795ce992eaa505ba52c7294872a79d293a (diff)
downloadfreebsd-ports-gnome-430838889b08d39c15f52756f11acd02cfbb26dc.tar.gz
freebsd-ports-gnome-430838889b08d39c15f52756f11acd02cfbb26dc.tar.zst
freebsd-ports-gnome-430838889b08d39c15f52756f11acd02cfbb26dc.zip
- add new option MULTIPLE_THREADS. With this option enabled libsee/dtoa.c is
compiled with proper thread locking. - bump PORTVERSION PR: ports/122525 Submitted by: maintainer
Diffstat (limited to 'lang')
-rw-r--r--lang/see-devel/Makefile10
-rw-r--r--lang/see-devel/files/patch-libsee_dtoa.c24
-rw-r--r--lang/see/Makefile10
-rw-r--r--lang/see/files/patch-libsee_dtoa.c24
4 files changed, 66 insertions, 2 deletions
diff --git a/lang/see-devel/Makefile b/lang/see-devel/Makefile
index 3f9857e3a411..765b611585e1 100644
--- a/lang/see-devel/Makefile
+++ b/lang/see-devel/Makefile
@@ -7,6 +7,7 @@
PORTNAME= see
PORTVERSION= 3.0.1376
+PORTREVISION= 1
CATEGORIES= lang devel
MASTER_SITES= http://www.evolane.com/download/mirror/etcl/ \
http://www.evolane.fr/download/mirror/etcl/
@@ -17,7 +18,8 @@ COMMENT= Simple ECMAScript Engine (SEE)
OPTIONS= GC "Use Boehm-Weiser garbage collection package" on \
OPTIMIZED_CFLAGS "Enable some additional optimizations" off \
- SEE_DEBUG "Internal SEE library debugging" off
+ SEE_DEBUG "Internal SEE library debugging" off \
+ MULTIPLE_THREADS "Enable thread-safety" on
CONFLICTS= see-[0-9]*
@@ -32,6 +34,10 @@ CONFIGURE_TARGET= --build=${MACHINE_ARCH}-portbld-freebsd${OSREL}
.include <bsd.port.pre.mk>
+.if defined(WITH_MULTIPLE_THREADS)
+CFLAGS+= -DMULTIPLE_THREADS
+.endif
+
.if !defined(WITH_SEE_DEBUG)
CFLAGS+= -DNDEBUG
.endif
@@ -44,9 +50,11 @@ CFLAGS+= -O3 -fomit-frame-pointer
LIB_DEPENDS+= gc:${PORTSDIR}/devel/boehm-gc
.else
CONFIGURE_ARGS+= --without-boehm-gc
+.if !defined(WITH_MULTIPLE_THREADS)
PTHREAD_CFLAGS=
PTHREAD_LIBS=
.endif
+.endif
post-patch:
@${REINPLACE_CMD} -e "s|PACKAGE_BUGREPORT='leonard@users|PACKAGE_BUGREPORT='leonard\\\@users|" \
diff --git a/lang/see-devel/files/patch-libsee_dtoa.c b/lang/see-devel/files/patch-libsee_dtoa.c
new file mode 100644
index 000000000000..d41a5da30863
--- /dev/null
+++ b/lang/see-devel/files/patch-libsee_dtoa.c
@@ -0,0 +1,24 @@
+--- libsee/dtoa.c.orig 2005-12-24 04:35:38.000000000 +0100
++++ libsee/dtoa.c 2008-04-07 11:30:11.529829910 +0200
+@@ -168,6 +168,11 @@
+ * the result overflows to +-Infinity or underflows to 0.
+ */
+
++#ifdef MULTIPLE_THREADS
++#include <pthread.h>
++static pthread_mutex_t mylock[2] = { PTHREAD_MUTEX_INITIALIZER, PTHREAD_MUTEX_INITIALIZER };
++#endif
++
+ #ifndef Long
+ #define Long long
+ #endif
+@@ -470,6 +475,9 @@
+ #ifndef MULTIPLE_THREADS
+ #define ACQUIRE_DTOA_LOCK(n) /*nothing*/
+ #define FREE_DTOA_LOCK(n) /*nothing*/
++#else
++#define ACQUIRE_DTOA_LOCK(n) pthread_mutex_lock(&mylock[n]);
++#define FREE_DTOA_LOCK(n) pthread_mutex_unlock(&mylock[n]);
+ #endif
+
+ #define Kmax 15
diff --git a/lang/see/Makefile b/lang/see/Makefile
index 3a21f2cc9000..180708490018 100644
--- a/lang/see/Makefile
+++ b/lang/see/Makefile
@@ -7,6 +7,7 @@
PORTNAME= see
PORTVERSION= 2.0.1131
+PORTREVISION= 1
CATEGORIES= lang devel
MASTER_SITES= http://www.powerband.net.au/~david.leonard/ \
http://freshmeat.net/redir/see/45974/url_tgz/
@@ -16,7 +17,8 @@ COMMENT= Simple ECMAScript Engine (SEE)
OPTIONS= GC "Use Boehm-Weiser garbage collection package" on \
OPTIMIZED_CFLAGS "Enable some additional optimizations" off \
- SEE_DEBUG "Internal SEE library debugging" off
+ SEE_DEBUG "Internal SEE library debugging" off \
+ MULTIPLE_THREADS "Enable thread-safety" on
CONFLICTS= see-devel-[0-9]*
@@ -33,6 +35,10 @@ CONFIGURE_TARGET= --build=${MACHINE_ARCH}-portbld-freebsd${OSREL}
.include <bsd.port.pre.mk>
+.if defined(WITH_MULTIPLE_THREADS)
+CFLAGS+= -DMULTIPLE_THREADS
+.endif
+
.if !defined(WITH_SEE_DEBUG)
CFLAGS+= -DNDEBUG
.endif
@@ -45,9 +51,11 @@ CFLAGS+= -O3 -fomit-frame-pointer
LIB_DEPENDS+= gc:${PORTSDIR}/devel/boehm-gc
.else
CONFIGURE_ARGS+= --without-boehm-gc
+.if !defined(WITH_MULTIPLE_THREADS)
PTHREAD_CFLAGS=
PTHREAD_LIBS=
.endif
+.endif
post-patch:
@${REINPLACE_CMD} -e "s|PACKAGE_BUGREPORT='leonard@users|PACKAGE_BUGREPORT='leonard\\\@users|" \
diff --git a/lang/see/files/patch-libsee_dtoa.c b/lang/see/files/patch-libsee_dtoa.c
new file mode 100644
index 000000000000..d41a5da30863
--- /dev/null
+++ b/lang/see/files/patch-libsee_dtoa.c
@@ -0,0 +1,24 @@
+--- libsee/dtoa.c.orig 2005-12-24 04:35:38.000000000 +0100
++++ libsee/dtoa.c 2008-04-07 11:30:11.529829910 +0200
+@@ -168,6 +168,11 @@
+ * the result overflows to +-Infinity or underflows to 0.
+ */
+
++#ifdef MULTIPLE_THREADS
++#include <pthread.h>
++static pthread_mutex_t mylock[2] = { PTHREAD_MUTEX_INITIALIZER, PTHREAD_MUTEX_INITIALIZER };
++#endif
++
+ #ifndef Long
+ #define Long long
+ #endif
+@@ -470,6 +475,9 @@
+ #ifndef MULTIPLE_THREADS
+ #define ACQUIRE_DTOA_LOCK(n) /*nothing*/
+ #define FREE_DTOA_LOCK(n) /*nothing*/
++#else
++#define ACQUIRE_DTOA_LOCK(n) pthread_mutex_lock(&mylock[n]);
++#define FREE_DTOA_LOCK(n) pthread_mutex_unlock(&mylock[n]);
+ #endif
+
+ #define Kmax 15