Import devel/spidermonkey 1.8.5

- built from the official upstream release
- needed for upcoming gnome/js update
- this is not an update to lang/spidermonkey, as that new version was
  built upon Ffx 4 js engine and probably only works on amd64/i386/ppc.
It builds on sparc64 but is broken at runtime. Not marking BROKEN-* to
allow depending ports to build. Other archs untested.
- special care was taken to ensure it doesnt conflict with
  lang/spidermonkey (install versionned binaries/headers..)
- ports wanting to use it should use devel/spidermonkey>=1.8,<1.9 to
  ensure the correct version is picked up

Tested in an amd64 bulk build.
ok/prodding ajacoutot@
This commit is contained in:
landry 2012-04-07 13:48:18 +00:00
parent 447d77c70a
commit 191bc6db26
13 changed files with 381 additions and 0 deletions

View File

@ -0,0 +1,55 @@
# $OpenBSD: Makefile,v 1.1.1.1 2012/04/07 13:48:18 landry Exp $
SHARED_ONLY= Yes
COMMENT = Mozilla C implementation of JavaScript
MOZILLA_VERSION = 1.8.5
DISTNAME = js185-1.0.0
PKGNAME = spidermonkey-${MOZILLA_VERSION}
SO_VERSION = 0.0
SHARED_LIBS = mozjs185 ${SO_VERSION}
CATEGORIES = devel
HOMEPAGE = http://www.mozilla.org/js/spidermonkey/
MASTER_SITES = http://ftp.mozilla.org/pub/mozilla.org/js/
# MPL
PERMIT_PACKAGE_CDROM= Yes
PERMIT_PACKAGE_FTP= Yes
PERMIT_DISTFILES_CDROM= Yes
PERMIT_DISTFILES_FTP= Yes
.if ${MACHINE_ARCH} == "i386"
PKG_ARGS+= -Djit=1 -Damd64=0
.elif ${MACHINE_ARCH} == "amd64"
PKG_ARGS+= -Djit=1 -Damd64=1
.else
PKG_ARGS+= -Djit=0 -Damd64=0
.endif
MODULES = lang/python
MODPY_RUNDEP = No
REGRESS_DEPENDS = ${MODPY_RUN_DEPENDS}
BUILD_DEPENDS = archivers/zip
LIB_DEPENDS = devel/nspr
WANTLIB = c m pthread readline nspr4 ncurses plc4 plds4 stdc++
SUBST_VARS += MOZILLA_VERSION
WRKDIST = ${WRKDIR}/js-${MOZILLA_VERSION}/js/src
USE_GMAKE = yes
CONFIGURE_STYLE = autoconf no-autoheader
CONFIGURE_ARGS = --with-pthread \
--with-system-nspr \
--enable-readline \
--enable-ctypes \
--enable-threadsafe
CONFIGURE_ENV += SO_VERSION="${SO_VERSION}" \
MOZILLA_VERSION="${MOZILLA_VERSION}" \
LIBS=-lncurses \
CPPFLAGS=-DJS_C_STRINGS_ARE_UTF8
.include <bsd.port.mk>

View File

@ -0,0 +1,5 @@
MD5 (js185-1.0.0.tar.gz) = pFdDZZOCIq3KCmvTMynLMg==
RMD160 (js185-1.0.0.tar.gz) = I+bdyB1bY+AVrswaEEstPTztUAU=
SHA1 (js185-1.0.0.tar.gz) = UqAUScSNehF7NfIT0+QmNXjYRtY=
SHA256 (js185-1.0.0.tar.gz) = XRL34fW0qZQ2aF2Xube3XwlNM1gCJ6qZjEBruubypoc=
SIZE (js185-1.0.0.tar.gz) = 6164605

View File

@ -0,0 +1,58 @@
$OpenBSD: patch-Makefile_in,v 1.1.1.1 2012/04/07 13:48:18 landry Exp $
Don't do the horrible symlink dance
--- Makefile.in.orig Thu Mar 31 21:08:36 2011
+++ Makefile.in Thu Apr 5 11:56:13 2012
@@ -95,7 +95,7 @@ MODULE_OPTIMIZE_FLAGS = -O2 -ip
endif
else # not INTEL_CXX
-MODULE_OPTIMIZE_FLAGS = -O3 -fstrict-aliasing
+MODULE_OPTIMIZE_FLAGS = -fstrict-aliasing
# We normally want -fomit-frame-pointer, but we want an explicit
# -fno-omit-frame-pointer if we're using a sampling profiler.
@@ -382,7 +382,7 @@ CPPSRCS += checks.cc \
# END enclude sources for V8 dtoa
#############################################
-ifeq (,$(filter-out powerpc sparc,$(TARGET_CPU)))
+ifeq (,$(filter-out powerpc sparc sparc64,$(TARGET_CPU)))
VPATH += $(srcdir)/assembler \
$(srcdir)/assembler/wtf \
@@ -852,10 +852,11 @@ install:: $(pkg_config_files)
$(SYSINSTALL) $(IFLAGS1) $^ $(DESTDIR)$(libdir)/pkgconfig
install:: $(INSTALLED_HEADERS)
- $(SYSINSTALL) $^ $(DESTDIR)$(includedir)/$(MODULE)
+ $(SYSINSTALL) $^ $(DESTDIR)$(includedir)/$(MODULE)-$(MOZILLA_VERSION)
install:: $(SCRIPTS)
- $(SYSINSTALL) $^ $(DESTDIR)$(bindir)
+ install js-config $(DESTDIR)$(bindir)/js-config-$(MOZILLA_VERSION)
+ install js $(DESTDIR)$(bindir)/js-$(MOZILLA_VERSION)
ifeq (,$(HOST_BIN_SUFFIX))
ifeq (.dylib,$(DLL_SUFFIX))
@@ -871,7 +872,7 @@ else
SHLIB_ANY_VER := $(DESTDIR)$(libdir)/$(SHARED_LIBRARY)
SHLIB_ABI_VER := $(DESTDIR)$(libdir)/$(SHARED_LIBRARY).$(SRCREL_ABI_VERSION)
SHLIB_EXACT_VER := $(DESTDIR)$(libdir)/$(SHARED_LIBRARY).$(SRCREL_VERSION)
-$(SHARED_LIBRARY): EXTRA_DSO_LDOPTS += -Wl,-soname,$(notdir $(SHLIB_ABI_VER))
+$(SHARED_LIBRARY): EXTRA_DSO_LDOPTS += -Wl,-soname,$(SHARED_LIBRARY)
endif
endif
@@ -885,12 +886,6 @@ ifeq (,$(HOST_BIN_SUFFIX))
@[ ! -h $(SHLIB_ANY_VER) ] || rm -f $(SHLIB_ANY_VER)
endif
$(SYSINSTALL) $(SHARED_LIBRARY) $(DESTDIR)$(libdir)
-ifeq (,$(HOST_BIN_SUFFIX))
- mv -f $(SHLIB_ANY_VER) $(SHLIB_EXACT_VER)
- @[ ! -h $(SHLIB_ABI_VER) ] || rm -f $(SHLIB_ABI_VER)
- ln -s $(SHLIB_EXACT_VER) $(SHLIB_ABI_VER)
- ln -s $(SHLIB_ABI_VER) $(SHLIB_ANY_VER)
-endif
endif
ifneq (,$(IMPORT_LIBRARY))
$(SYSINSTALL) $(IMPORT_LIBRARY) $(DESTDIR)$(libdir)

View File

@ -0,0 +1,40 @@
$OpenBSD: patch-configure_in,v 1.1.1.1 2012/04/07 13:48:18 landry Exp $
--- configure.in.orig Thu Mar 31 21:08:36 2011
+++ configure.in Wed Apr 4 16:46:03 2012
@@ -1211,7 +1211,7 @@ WIN_TOP_SRC=
MOZ_USER_DIR=".mozilla"
MOZ_JS_LIBS='-L$(libdir) -lmozjs'
-MOZ_FIX_LINK_PATHS='-Wl,-rpath-link,$(LIBXUL_DIST)/bin -Wl,-rpath-link,$(prefix)/lib'
+MOZ_FIX_LINK_PATHS='-Wl,-rpath-link,$(LIBXUL_DIST)/bin -Wl,-rpath-link,$(PREFIX)/lib -L$(LIBXUL_DIST)/bin'
MOZ_COMPONENT_NSPR_LIBS='-L$(LIBXUL_DIST)/bin $(NSPR_LIBS)'
@@ -2582,7 +2582,7 @@ ia64*-hpux*)
;;
*-openbsd*)
- DLL_SUFFIX=".so.1.0"
+ DLL_SUFFIX=".so.${SO_VERSION}"
DSO_CFLAGS=''
DSO_PIC_CFLAGS='-fPIC'
DSO_LDOPTS='-shared -fPIC'
@@ -2956,7 +2956,7 @@ arm*-*)
AC_DEFINE(JS_CPU_ARM)
AC_DEFINE(JS_NUNBOX32)
;;
-sparc*-*)
+sparc-*)
ENABLE_TRACEJIT=1
NANOJIT_ARCH=Sparc
AC_DEFINE(JS_CPU_SPARC)
@@ -3039,6 +3039,9 @@ case "$target" in
AC_DEFINE(AVMPLUS_UNIX)
;;
*-freebsd*|*-kfreebsd*)
+ AC_DEFINE(AVMPLUS_UNIX)
+ ;;
+*-openbsd*)
AC_DEFINE(AVMPLUS_UNIX)
;;
*-gnu*)

View File

@ -0,0 +1,30 @@
$OpenBSD: patch-ctypes_libffi_configure,v 1.1.1.1 2012/04/07 13:48:18 landry Exp $
--- ctypes/libffi/configure.orig Thu Mar 31 21:08:36 2011
+++ ctypes/libffi/configure Sun Apr 3 12:38:25 2011
@@ -11212,7 +11212,7 @@ case "$host" in
TARGET=FRV; TARGETDIR=frv
;;
- hppa*-*-linux* | parisc*-*-linux*)
+ hppa*-*-linux* | hppa*-*-openbsd* | parisc*-*-linux*)
TARGET=PA_LINUX; TARGETDIR=pa
;;
hppa*64-*-hpux*)
@@ -11255,7 +11255,7 @@ case "$host" in
mips-sgi-irix5.* | mips-sgi-irix6.*)
TARGET=MIPS; TARGETDIR=mips
;;
- mips*-*-linux*)
+ mips*-*-linux* | mips*-*-openbsd* )
# Support 128-bit long double for NewABI.
HAVE_LONG_DOUBLE='defined(__mips64)'
TARGET=MIPS; TARGETDIR=mips
@@ -11277,7 +11277,7 @@ case "$host" in
powerpc-*-aix* | rs6000-*-aix*)
TARGET=POWERPC_AIX; TARGETDIR=powerpc
;;
- powerpc-*-freebsd*)
+ powerpc-*-freebsd* | powerpc-*-openbsd* )
TARGET=POWERPC_FREEBSD; TARGETDIR=powerpc
;;
powerpc*-*-rtems*)

View File

@ -0,0 +1,43 @@
$OpenBSD: patch-jsnativestack_cpp,v 1.1.1.1 2012/04/07 13:48:18 landry Exp $
--- jsnativestack.cpp.orig Thu Mar 31 21:08:36 2011
+++ jsnativestack.cpp Sun Apr 3 12:38:25 2011
@@ -50,7 +50,7 @@
#elif defined(XP_MACOSX) || defined(DARWIN) || defined(XP_UNIX)
# include <pthread.h>
-# if defined(__FreeBSD__)
+# if defined(__FreeBSD__) || defined (__OpenBSD__)
# include <pthread_np.h>
# endif
@@ -198,24 +198,21 @@ GetNativeStackBaseImpl()
pthread_attr_init(&sattr);
# if defined(PTHREAD_NP_H) || defined(_PTHREAD_NP_H_) || defined(NETBSD)
/* e.g. on FreeBSD 4.8 or newer, neundorf@kde.org */
- pthread_attr_get_np(thread, &sattr);
# else
/*
* FIXME: this function is non-portable;
* other POSIX systems may have different np alternatives
*/
- pthread_getattr_np(thread, &sattr);
# endif
void *stackBase = 0;
size_t stackSize = 0;
-# ifdef DEBUG
- int rc =
-# endif
- pthread_attr_getstack(&sattr, &stackBase, &stackSize);
- JS_ASSERT(!rc);
- JS_ASSERT(stackBase);
- pthread_attr_destroy(&sattr);
+ stack_t ss;
+ int rslt;
+
+ rslt = pthread_stackseg_np(pthread_self(), &ss);
+ stackBase = (void*)((size_t)ss.ss_sp - ss.ss_size);
+ stackSize = ss.ss_size;
# if JS_STACK_GROWTH_DIRECTION > 0
return stackBase;

View File

@ -0,0 +1,21 @@
$OpenBSD: patch-jsval_h,v 1.1.1.1 2012/04/07 13:48:18 landry Exp $
http://hg.mozilla.org/tracemonkey/rev/68203913d04c
--- jsval.h.orig Thu Mar 31 21:08:36 2011
+++ jsval.h Wed Apr 4 16:32:50 2012
@@ -347,6 +347,7 @@ typedef union jsval_layout
int32 i32;
uint32 u32;
JSWhyMagic why;
+ jsuword word;
} payload;
} s;
double asDouble;
@@ -815,7 +816,7 @@ extern "C++"
#else /* defined(JS_USE_JSVAL_JSID_STRUCT_TYPES) */
/* Use different primitive types so overloading works. */
-typedef JSVAL_ALIGNMENT uint64 jsval;
+typedef JSVAL_ALIGNMENT uint64_t jsval;
typedef ptrdiff_t jsid;
/* Internal helper macros */

View File

@ -0,0 +1,9 @@
$OpenBSD: patch-mozjs185_pc_in,v 1.1.1.1 2012/04/07 13:48:18 landry Exp $
--- mozjs185.pc.in.orig Wed Apr 4 15:45:40 2012
+++ mozjs185.pc.in Wed Apr 4 15:45:56 2012
@@ -7,4 +7,4 @@ Description: The Mozilla library for JavaScript 1.8.5
Version: %MOZILLA_VERSION%
Requires: nspr >= 4.7
Libs: -L${libdir} -lmozjs185
-Cflags: -I${includedir}/js
+Cflags: -I${includedir}/js-%MOZILLA_VERSION%

View File

@ -0,0 +1,11 @@
$OpenBSD: patch-nanojit_NativeSparc_cpp,v 1.1.1.1 2012/04/07 13:48:18 landry Exp $
--- nanojit/NativeSparc.cpp.orig Thu Mar 31 21:08:36 2011
+++ nanojit/NativeSparc.cpp Sun Apr 3 12:38:25 2011
@@ -39,6 +39,7 @@
*
* ***** END LICENSE BLOCK ***** */
+#include <sys/types.h>
#include <sys/mman.h>
#include <errno.h>
#include "nanojit.h"

View File

@ -0,0 +1,2 @@
SpiderMonkey is the code-name for the Mozilla's C implementation of
JavaScript.

View File

@ -0,0 +1,2 @@
@comment $OpenBSD: PFRAG.amd64,v 1.1.1.1 2012/04/07 13:48:18 landry Exp $
include/js-${MOZILLA_VERSION}/NativeX64.h

View File

@ -0,0 +1,18 @@
@comment $OpenBSD: PFRAG.jit,v 1.1.1.1 2012/04/07 13:48:18 landry Exp $
include/js-${MOZILLA_VERSION}/Allocator.h
include/js-${MOZILLA_VERSION}/Assembler.h
include/js-${MOZILLA_VERSION}/CodeAlloc.h
include/js-${MOZILLA_VERSION}/Containers.h
include/js-${MOZILLA_VERSION}/Fragmento.h
include/js-${MOZILLA_VERSION}/LIR.h
include/js-${MOZILLA_VERSION}/LIRopcode.tbl
include/js-${MOZILLA_VERSION}/Native.h
include/js-${MOZILLA_VERSION}/NativeCommon.h
include/js-${MOZILLA_VERSION}/RegAlloc.h
include/js-${MOZILLA_VERSION}/VMPI.h
include/js-${MOZILLA_VERSION}/Writer.h
include/js-${MOZILLA_VERSION}/avmplus.h
include/js-${MOZILLA_VERSION}/jsbuiltins.h
include/js-${MOZILLA_VERSION}/nanojit.h
include/js-${MOZILLA_VERSION}/njconfig.h
include/js-${MOZILLA_VERSION}/njcpudetect.h

View File

@ -0,0 +1,87 @@
@comment $OpenBSD: PLIST,v 1.1.1.1 2012/04/07 13:48:18 landry Exp $
@option no-default-conflict
@conflict spidermonkey->=1.8.5,<1.9.2
%%jit%%
%%amd64%%
@bin bin/js-${MOZILLA_VERSION}
bin/js-config-${MOZILLA_VERSION}
include/js-${MOZILLA_VERSION}/
include/js-${MOZILLA_VERSION}/js-config.h
include/js-${MOZILLA_VERSION}/js.msg
include/js-${MOZILLA_VERSION}/jsanalyze.h
include/js-${MOZILLA_VERSION}/jsapi.h
include/js-${MOZILLA_VERSION}/jsarena.h
include/js-${MOZILLA_VERSION}/jsarray.h
include/js-${MOZILLA_VERSION}/jsatom.h
include/js-${MOZILLA_VERSION}/jsautocfg.h
include/js-${MOZILLA_VERSION}/jsautokw.h
include/js-${MOZILLA_VERSION}/jsbit.h
include/js-${MOZILLA_VERSION}/jsbool.h
include/js-${MOZILLA_VERSION}/jscell.h
include/js-${MOZILLA_VERSION}/jsclist.h
include/js-${MOZILLA_VERSION}/jsclone.h
include/js-${MOZILLA_VERSION}/jscntxt.h
include/js-${MOZILLA_VERSION}/jscompartment.h
include/js-${MOZILLA_VERSION}/jscompat.h
include/js-${MOZILLA_VERSION}/jsdate.h
include/js-${MOZILLA_VERSION}/jsdbgapi.h
include/js-${MOZILLA_VERSION}/jsdhash.h
include/js-${MOZILLA_VERSION}/jsdtoa.h
include/js-${MOZILLA_VERSION}/jsemit.h
include/js-${MOZILLA_VERSION}/jsfriendapi.h
include/js-${MOZILLA_VERSION}/jsfun.h
include/js-${MOZILLA_VERSION}/jsgc.h
include/js-${MOZILLA_VERSION}/jsgcchunk.h
include/js-${MOZILLA_VERSION}/jsgcstats.h
include/js-${MOZILLA_VERSION}/jshash.h
include/js-${MOZILLA_VERSION}/jshashtable.h
include/js-${MOZILLA_VERSION}/jshotloop.h
include/js-${MOZILLA_VERSION}/jsinterp.h
include/js-${MOZILLA_VERSION}/jsinttypes.h
include/js-${MOZILLA_VERSION}/jsiter.h
include/js-${MOZILLA_VERSION}/jslock.h
include/js-${MOZILLA_VERSION}/jslong.h
include/js-${MOZILLA_VERSION}/jsmath.h
include/js-${MOZILLA_VERSION}/jsobj.h
include/js-${MOZILLA_VERSION}/jsobjinlines.h
include/js-${MOZILLA_VERSION}/json.h
include/js-${MOZILLA_VERSION}/jsopcode.h
include/js-${MOZILLA_VERSION}/jsopcode.tbl
include/js-${MOZILLA_VERSION}/jsopcodeinlines.h
include/js-${MOZILLA_VERSION}/jsotypes.h
include/js-${MOZILLA_VERSION}/jsparse.h
include/js-${MOZILLA_VERSION}/jsperf.h
include/js-${MOZILLA_VERSION}/jsprf.h
include/js-${MOZILLA_VERSION}/jsprobes.h
include/js-${MOZILLA_VERSION}/jspropertycache.h
include/js-${MOZILLA_VERSION}/jspropertycacheinlines.h
include/js-${MOZILLA_VERSION}/jspropertytree.h
include/js-${MOZILLA_VERSION}/jsproto.tbl
include/js-${MOZILLA_VERSION}/jsproxy.h
include/js-${MOZILLA_VERSION}/jsprvtd.h
include/js-${MOZILLA_VERSION}/jspubtd.h
include/js-${MOZILLA_VERSION}/jsreflect.h
include/js-${MOZILLA_VERSION}/jsregexp.h
include/js-${MOZILLA_VERSION}/jsscan.h
include/js-${MOZILLA_VERSION}/jsscope.h
include/js-${MOZILLA_VERSION}/jsscript.h
include/js-${MOZILLA_VERSION}/jsscriptinlines.h
include/js-${MOZILLA_VERSION}/jsstaticcheck.h
include/js-${MOZILLA_VERSION}/jsstdint.h
include/js-${MOZILLA_VERSION}/jsstr.h
include/js-${MOZILLA_VERSION}/jstl.h
include/js-${MOZILLA_VERSION}/jstracer.h
include/js-${MOZILLA_VERSION}/jstypedarray.h
include/js-${MOZILLA_VERSION}/jstypes.h
include/js-${MOZILLA_VERSION}/jsutil.h
include/js-${MOZILLA_VERSION}/jsval.h
include/js-${MOZILLA_VERSION}/jsvalue.h
include/js-${MOZILLA_VERSION}/jsvector.h
include/js-${MOZILLA_VERSION}/jsversion.h
include/js-${MOZILLA_VERSION}/jswrapper.h
include/js-${MOZILLA_VERSION}/jsxdrapi.h
include/js-${MOZILLA_VERSION}/jsxml.h
include/js-${MOZILLA_VERSION}/prmjtime.h
lib/libmozjs185-1.0.a
@lib lib/libmozjs185.so.${LIBmozjs185_VERSION}
lib/pkgconfig/mozjs185.pc