Index: lang/spidermonkey17/Makefile
===================================================================
--- lang/spidermonkey17/Makefile	(revision 442454)
+++ lang/spidermonkey17/Makefile	(working copy)
@@ -3,7 +3,7 @@
 
 PORTNAME=	spidermonkey17
 DISTVERSION=	1.7.0
-PORTREVISION=	2
+PORTREVISION=	3
 CATEGORIES=	lang
 MASTER_SITES=	MOZILLA/js
 DISTNAME=	js-${DISTVERSION}
@@ -40,7 +40,7 @@
 		jsstr.h jstypes.h jsxdrapi.h jsxml.h \
 		js.msg jsproto.tbl
 
-PLIST_FILES=	bin/js lib/libjs.so lib/libjs.so.1 ${JSH:S,^,include/,}
+PLIST_FILES=	bin/js lib/libjs.so lib/libjs.so.1 ${JSH:S,^,include/js-1.7/,}
 WRKSRC=		${WRKDIR}/${SRC_DIR}
 EXTRACT_AFTER_ARGS=	--exclude js/jsd
 
@@ -63,6 +63,8 @@
 		${STAGEDIR}${PREFIX}/lib
 	${LN} -sf libjs.so ${STAGEDIR}${PREFIX}/lib/libjs.so.1
 	${CP} ${WRKSRC}/${OPSYS}`${UNAME} -r`_DBG.OBJ/jsautocfg.h ${WRKSRC}
-	@${INSTALL_DATA} ${JSH:S,^,${WRKSRC}/,} ${STAGEDIR}${PREFIX}/include/
+	@${MKDIR} ${STAGEDIR}${PREFIX}/include/js-1.7
+	@${INSTALL_DATA} ${JSH:S,^,${WRKSRC}/,} \
+		${STAGEDIR}${PREFIX}/include/js-1.7/
 
 .include <bsd.port.mk>
Index: lang/p5-JavaScript-SpiderMonkey/Makefile
===================================================================
--- lang/p5-JavaScript-SpiderMonkey/Makefile	(revision 442454)
+++ lang/p5-JavaScript-SpiderMonkey/Makefile	(working copy)
@@ -19,6 +19,7 @@
 
 USE_PERL5=	configure
 USES=		perl5
+CFLAGS+=	-I${LOCALBASE}/include/js-1.7/
 
 post-patch:
 	@${REINPLACE_CMD} -e 's|libjs.a|libjs.so|' ${WRKSRC}/Makefile.PL
Index: lang/p5-JavaScript-SpiderMonkey/files/patch-Makefile.PL
===================================================================
--- lang/p5-JavaScript-SpiderMonkey/files/patch-Makefile.PL	(revision 442454)
+++ lang/p5-JavaScript-SpiderMonkey/files/patch-Makefile.PL	(working copy)
@@ -1,14 +1,17 @@
---- Makefile.PL.orig	2010-11-17 13:51:38.000000000 +0100
-+++ Makefile.PL	2010-11-17 13:59:54.000000000 +0100
-@@ -71,11 +71,6 @@
+--- Makefile.PL.orig	2011-10-23 12:27:21.000000000 +0200
++++ Makefile.PL	2017-06-03 21:50:44.801687000 +0200
+@@ -68,13 +68,8 @@
+       next if ! -f $libfile;
+       my $include_path = $possible_install_paths{$install_path};
+       foreach my $c_header(@c_header_files) {
+-        if (-f "$include_path/$c_header") {
++        if (-f "$include_path/js-1.7/$c_header") {
+           my $include_dir = "$include_path/$c_header";
+-          $include_dir =~ s/$c_header$//;
+-          push @JS_INCL_DIRS, $include_dir;
+-        }
+-        foreach my $headerfile(glob "$include_path/*/$c_header") {
+-          my $include_dir = $headerfile;
            $include_dir =~ s/$c_header$//;
            push @JS_INCL_DIRS, $include_dir;
          }
--        foreach my $headerfile(glob "$include_path/*/$c_header") {
--          my $include_dir = $headerfile;
--          $include_dir =~ s/$c_header$//;
--          push @JS_INCL_DIRS, $include_dir;
--        }
-       }
-       if (scalar(@JS_INCL_DIRS) == scalar(@c_header_files)) {
-         $JS_LIB_DIR = $libfile;
Index: net/mediatomb/Makefile
===================================================================
--- net/mediatomb/Makefile	(revision 442454)
+++ net/mediatomb/Makefile	(working copy)
@@ -66,7 +66,7 @@
 MYSQL_CONFIGURE_ON= 		--with-mysql-cfg="${LOCALBASE}/bin/mysql_config"
 
 JS_CONFIGURE_ENABLE=		libjs
-JS_CONFIGURE_ON=		--with-js-h="${LOCALBASE}/include" \
+JS_CONFIGURE_ON=		--with-js-h="${LOCALBASE}/include/js-1.7" \
 				--with-js-libs="${LOCALBASE}/lib"
 JS_LIB_DEPENDS=			libjs.so:lang/spidermonkey17
 
Index: www/elinks/Makefile
===================================================================
--- www/elinks/Makefile	(revision 442454)
+++ www/elinks/Makefile	(working copy)
@@ -94,7 +94,8 @@
 SPIDERMONKEY_BUILD_DEPENDS=	${LOCALBASE}/lib/libjs.so:lang/spidermonkey17
 SPIDERMONKEY_RUN_DEPENDS=	js:lang/spidermonkey17
 SPIDERMONKEY_LIB_DEPENDS=	libnspr4.so:devel/nspr
-SPIDERMONKEY_CFLAGS=		-I${LOCALBASE}/include/nspr
+SPIDERMONKEY_CFLAGS=		-I${LOCALBASE}/include/nspr \
+				-I${LOCALBASE}/include/js-1.7
 SPIDERMONKEY_LDFLAGS=		-lnspr4 -pthread -lpthread -lm
 SPIDERMONKEY_CONFIGURE_ON=	--enable-sm-scripting --with-spidermonkey
 SPIDERMONKEY_CONFIGURE_OFF=	--disable-sm-scripting --without-spidermonkey