aboutsummaryrefslogtreecommitdiffstats
path: root/lang
diff options
context:
space:
mode:
authorolgeni <olgeni@FreeBSD.org>2013-05-05 21:04:34 +0800
committerolgeni <olgeni@FreeBSD.org>2013-05-05 21:04:34 +0800
commitc240d1aad42a129423f0ef6a962bf710c283716a (patch)
tree7ff3a8c5a5e3b05feecfcb81c07a2226288a813e /lang
parentedcdb5f5011441e866d8dfc0b82df3e211cbf311 (diff)
downloadfreebsd-ports-gnome-c240d1aad42a129423f0ef6a962bf710c283716a.tar.gz
freebsd-ports-gnome-c240d1aad42a129423f0ef6a962bf710c283716a.tar.zst
freebsd-ports-gnome-c240d1aad42a129423f0ef6a962bf710c283716a.zip
Add lang/erlang-runtime15.
This port is indented for developers and port maintainers. It is a copy of lang/erlang with a few differences: - Nothing is installed in $PREFIX/bin - Libraries are installed in $PREFIX/lib/erlang15 - You have to change your PATH to actually use it - Support for building PLTs is removed - Other ports are not supposed to install anything inside this environment What is this for: - Building Erlang applications using the R15 runtime, once R16 is committed (think Riak). - Building Erlang applications when there are conflicts with modules provided by other ports (for example, the RabbitMQ client libraries conflict with the server code installed by net/rabbitmq). - Testing new Erlang versions before the main port is upgraded.
Diffstat (limited to 'lang')
-rw-r--r--lang/Makefile1
-rw-r--r--lang/erlang-runtime15/Makefile263
-rw-r--r--lang/erlang-runtime15/Makefile.lib59
-rw-r--r--lang/erlang-runtime15/Makefile.man628
-rw-r--r--lang/erlang-runtime15/distinfo18
-rw-r--r--lang/erlang-runtime15/files/epmd.in25
-rw-r--r--lang/erlang-runtime15/files/patch-Makefile.in23
-rw-r--r--lang/erlang-runtime15/files/patch-erts-emulator-Makefile.in14
-rw-r--r--lang/erlang-runtime15/files/patch-erts_emulator_drivers_common_efile__drv.c337
-rw-r--r--lang/erlang-runtime15/files/patch-erts_etc_common_erlc.c13
-rw-r--r--lang/erlang-runtime15/files/patch-erts_etc_unix_run__erl.c15
-rw-r--r--lang/erlang-runtime15/files/patch-lib_erl__interface_src_connect_ei__resolve.c15
-rw-r--r--lang/erlang-runtime15/files/patch-lib_et_src_et__gs__contents__viewer.erl13
-rw-r--r--lang/erlang-runtime15/files/patch-lib_et_src_et__gs__viewer.erl15
-rw-r--r--lang/erlang-runtime15/files/patch-lib_gs_src_tool__utils.erl87
-rw-r--r--lang/erlang-runtime15/files/patch-lib_kernel_test_file__SUITE.erl83
-rw-r--r--lang/erlang-runtime15/files/patch-lib_odbc_c__src_odbcserver.c14
-rw-r--r--lang/erlang-runtime15/files/patch-lib_runtime__tools_src_observer__backend.erl14
-rw-r--r--lang/erlang-runtime15/files/patch-lib_ssl_src_ssl__manager.erl14
-rw-r--r--lang/erlang-runtime15/files/patch-lib_stdlib_src_calendar.erl29
-rw-r--r--lang/erlang-runtime15/files/pkg-message.in15
-rw-r--r--lang/erlang-runtime15/pkg-descr10
-rw-r--r--lang/erlang-runtime15/pkg-plist17
23 files changed, 1722 insertions, 0 deletions
diff --git a/lang/Makefile b/lang/Makefile
index 795b326797b4..15ce05875318 100644
--- a/lang/Makefile
+++ b/lang/Makefile
@@ -58,6 +58,7 @@
SUBDIR += emacs-lisp-intro
SUBDIR += embryo
SUBDIR += erlang
+ SUBDIR += erlang-runtime15
SUBDIR += execline
SUBDIR += expect
SUBDIR += expect-devel
diff --git a/lang/erlang-runtime15/Makefile b/lang/erlang-runtime15/Makefile
new file mode 100644
index 000000000000..dad525d8aee5
--- /dev/null
+++ b/lang/erlang-runtime15/Makefile
@@ -0,0 +1,263 @@
+# Created by: ruslan@shevchenko.kiev.ua
+# $FreeBSD$
+
+PORTNAME= erlang
+PORTVERSION= 15.b.03.1
+CATEGORIES= lang parallel java
+MASTER_SITES= http://www.erlang.org/download/:erlangorg \
+ http://erlang.stacken.kth.se/download/:erlangorg \
+ http://www.csd.uu.se/ftp/mirror/erlang/download/:erlangorg \
+ http://www.erlang.se/doc/:erlangse \
+ http://www.erlang.se/publications/:publications \
+ http://www.sics.se/~joe/thesis/:joe \
+ ${MASTER_SITE_LOCAL:S/$/:local/:S,%SUBDIR%/,olgeni/,}
+PKGNAMESUFFIX= -runtime
+DISTNAME= otp_src_${ERL_RELEASE}
+DISTFILES= ${DISTNAME}${EXTRACT_SUFX}:erlangorg \
+ ${ERLANG_MAN}:erlangorg
+DIST_SUBDIR= erlang
+EXTRACT_ONLY= ${DISTNAME}${EXTRACT_SUFX}
+
+PATCH_SITES= http://www.erlang.org/download
+
+MAINTAINER= olgeni@FreeBSD.org
+COMMENT= A functional programming language from Ericsson
+
+WRKSRC= ${WRKDIR}/otp_src_R15B03
+
+ERLANG_LIB= ${PORTNAME}${PORTVERSION:C/\..*//}
+
+SUB_FILES= pkg-message
+SUB_LIST= TOOLS_VSN=${TOOLS_VSN}
+PLIST_SUB= ERLANG_LIB=${ERLANG_LIB}
+
+MAKE_JOBS_UNSAFE=yes
+
+OPTIONS_DEFINE= GCC46 DOCS GS HIPE JAVA KQUEUE ODBC OPENSSL SCTP SMP THREADS WX DTRACE
+OPTIONS_SINGLE= ODBC
+OPTIONS_SINGLE_ODBC= IODBC UNIXODBC
+
+GCC46_DESC= Use gcc 4.6
+HIPE_DESC= Build native HiPE compiler
+KQUEUE_DESC= Enable Kernel Poll (kqueue) support
+SCTP_DESC= Enable SCTP support
+SMP_DESC= Enable SMP support
+WX_DESC= Enable WX application
+GS_DESC= Enable GS application (deprecated)
+DTRACE_DESC= Enable DTrace support (experimental)
+
+OPTIONS_DEFAULT=SMP OPENSSL THREADS SCTP KQUEUE
+
+ERL_RELEASE= R${PORTVERSION:S/.//g:U:S/1$/-1/}
+
+.include <bsd.port.options.mk>
+
+.if ${PORT_OPTIONS:MDOCS}
+DISTFILES+= ${ERLANG_DOCS}:erlangorg \
+ ${DOC_DISTFILES}
+DOC_DISTFILES= armstrong_thesis_2003.pdf:joe \
+ bjarnelic.pdf:publications \
+ erlang-book-part1.pdf:erlangorg \
+ master_thesis_patterns.pdf:local \
+ mnesia_overview.pdf:publications \
+ programming_rules.pdf:erlangse
+.endif
+
+# See http://wiki.freebsd.org/DTrace to learn how to enable DTrace
+# on your system. You will need to configure STRIP, WITH_CTF and
+# CFLAGS in your make.conf before building.
+
+# If you run Erlang and get a message resembling "WARNING: number of
+# probes fixed does not match the number of defined probes (54 != 132,
+# respectively)" you probably misconfigured DTrace in some way.
+
+.if ${ARCH} == "amd64" && ${PORT_OPTIONS:MDTRACE} && ! ${PORT_OPTIONS:MGCC46}
+IGNORE= DTRACE support on amd64 requires GCC46 option
+.endif
+
+.if ${PORT_OPTIONS:MGCC46}
+USE_GCC?= 4.6+
+.endif
+
+.if ${PORT_OPTIONS:MDTRACE}
+CONFIGURE_ARGS+=--with-dynamic-trace=dtrace
+.else
+CONFIGURE_ARGS+=--without-dynamic-trace
+.endif
+
+.if ${PORT_OPTIONS:MOPENSSL}
+USE_OPENSSL= yes
+CONFIGURE_ARGS+=--with-ssl=${OPENSSLBASE}
+.else
+CONFIGURE_ARGS+=--without-ssl
+.endif
+
+.if ${PORT_OPTIONS:MJAVA}
+USE_JAVA= yes
+CONFIGURE_ARGS+=--with-javac
+CONFIGURE_ENV+= ac_cv_prog_JAVAC="${JAVAC}"
+.else
+CONFIGURE_ARGS+=--without-javac
+.endif
+
+.if ${PORT_OPTIONS:MHIPE}
+CONFIGURE_ARGS+=--enable-hipe
+.else
+CONFIGURE_ARGS+=--disable-hipe
+.endif
+
+.if ${PORT_OPTIONS:MKQUEUE}
+CONFIGURE_ARGS+=--enable-kernel-poll
+.else
+CONFIGURE_ARGS+=--disable-kernel-poll
+.endif
+
+.if ${PORT_OPTIONS:MGS}
+USE_TK_RUN= yes
+.endif
+
+.if ${PORT_OPTIONS:MWX}
+USE_WX= 2.8+
+WX_COMPS= wx contrib
+WX_UNICODE= yes
+CONFIGURE_ARGS+=--with-wx-config=${WX_CONFIG}
+.endif
+
+USE_GMAKE= yes
+USE_CSTD= gnu89
+USE_PERL5= yes
+USE_RC_SUBR= epmd
+GNU_CONFIGURE= yes
+
+.if ${PORT_OPTIONS:MODBC}
+CONFIGURE_ARGS+=--with-odbc
+.if ${PORT_OPTIONS:MUNIXODBC}
+LIB_DEPENDS+= odbc:${PORTSDIR}/databases/unixODBC
+.elif ${PORT_OPTIONS:MIODBC}
+LIB_DEPENDS+= iodbc:${PORTSDIR}/databases/libiodbc
+.endif
+.else
+CONFIGURE_ARGS+=--without-odbc
+.endif
+
+ERLANG_MAN= otp_doc_man_${ERL_RELEASE}.tar.gz
+ERLANG_DOCS= otp_doc_html_${ERL_RELEASE}.tar.gz
+ERLANG_PLIST= ${WRKDIR}/pkg-plist
+
+.if ${PORT_OPTIONS:MTHREADS}
+CONFIGURE_ARGS+=--enable-threads
+.else
+CONFIGURE_ARGS+=--disable-threads
+.endif
+
+.if ${PORT_OPTIONS:MSCTP}
+CONFIGURE_ARGS+=--enable-sctp
+.else
+CONFIGURE_ARGS+=--disable-sctp
+.endif
+
+# enabling --enable-smp-support crashes the OS when
+# net_kernel:start([node_name, shortnames]) invoked repeatedly
+# TODO verify if it still applies
+
+.if ${PORT_OPTIONS:MSMP}
+CONFIGURE_ARGS+=--enable-smp-support
+.else
+CONFIGURE_ARGS+=--disable-smp-support
+.endif
+
+.if ${ARCH} == i386
+MAKE_ARGS+= ARCH=x86
+.endif
+
+# The man-pages are put (in spite of FreeBSD's port convention) in a private
+# subdir. This is to avoid cluttering up the man page name space. Also the
+# Erlang man pages are more of internal documentation using the man format than
+# actual system man pages. (erl.1 and epmd.1 perhaps being the exception).
+
+NO_MANCOMPRESS= yes
+
+MAN1PREFIX= ${PREFIX}/lib/${ERLANG_LIB}
+MAN3PREFIX= ${PREFIX}/lib/${ERLANG_LIB}
+MAN4PREFIX= ${PREFIX}/lib/${ERLANG_LIB}
+MAN6PREFIX= ${PREFIX}/lib/${ERLANG_LIB}
+
+# Install documentation. (HTML docs need to be in same dir as the
+# rest, not in share/doc/erlang as it should, because of relative
+# links in the documentation.
+post-install:
+ @for SECTION in 1 3 4 6; do \
+ ${TAR} --unlink -xzpf ${DISTDIR}/${DIST_SUBDIR}/${ERLANG_MAN} \
+ -C ${PREFIX}/lib/${ERLANG_LIB} \
+ "man/man$${SECTION}/*.$${SECTION}" || ${TRUE}; \
+ done
+ @${RM} -rf ${PREFIX}/lib/${ERLANG_LIB}/man/cat?
+.if ${PORT_OPTIONS:MDOCS}
+ @${TAR} --unlink -xzpf ${DISTDIR}/${DIST_SUBDIR}/${ERLANG_DOCS} \
+ -C ${PREFIX}/lib/${ERLANG_LIB}
+ @${INSTALL_DATA} ${WRKSRC}/lib/dialyzer/doc/*.txt \
+ ${PREFIX}/lib/${ERLANG_LIB}/lib/dialyzer-*/doc/
+
+ @${MKDIR} ${DOCSDIR}
+.for FILE in ${DOC_DISTFILES}
+ @${INSTALL_DATA} ${DISTDIR}/${DIST_SUBDIR}/$$(expr ${FILE} : '\([^:]*\)') ${DOCSDIR}
+.endfor
+.endif
+ @${CHOWN} -R ${SHAREOWN}:${SHAREGRP} ${PREFIX}/lib/${ERLANG_LIB}
+ @${CHMOD} -R o+rX-w,g+rX-w ${PREFIX}/lib/${ERLANG_LIB}
+
+# All non-library files.
+
+ @cd ${PREFIX}; ${FIND} lib/${ERLANG_LIB}/* -type d -empty \
+ | ${GREP} -v "^lib/${ERLANG_LIB}/lib" \
+ | ${SORT} \
+ | ${SED} -e 's#^#@exec ${MKDIR} %D/#g' \
+ > ${ERLANG_PLIST}
+
+ @cd ${PREFIX}; ${FIND} lib/${ERLANG_LIB}/* -type f -o -type l \
+ | ${GREP} -v "^lib/${ERLANG_LIB}/man" \
+ | ${GREP} -v "^lib/${ERLANG_LIB}/lib" \
+ | ${SORT} \
+ >> ${ERLANG_PLIST}
+
+# Stock OTP libraries.
+
+ @for LIBRARY in ${OTP_LIBS}; do \
+ cd ${PREFIX}; ${TEST} -d lib/${ERLANG_LIB}/lib/$${LIBRARY} \
+ && ${FIND} lib/${ERLANG_LIB}/lib/$${LIBRARY} -type f -o -type l; \
+ done | ${SORT} >> ${ERLANG_PLIST}
+
+# Stock OTP library directories.
+
+ @for LIBRARY in ${OTP_LIBS}; do \
+ cd ${PREFIX}; ${TEST} -d lib/${ERLANG_LIB}/lib/$${LIBRARY} \
+ && ${FIND} lib/${ERLANG_LIB}/lib/$${LIBRARY} -type d -empty \
+ | ${SED} -e 's#^#@exec ${MKDIR} %D/#g'; \
+ done | ${SORT} >> ${ERLANG_PLIST}
+
+ @for LIBRARY in ${OTP_LIBS}; do \
+ cd ${PREFIX}; ${TEST} -d lib/${ERLANG_LIB}/lib/$${LIBRARY} \
+ && ${FIND} lib/${ERLANG_LIB}/lib/$${LIBRARY} -type d \
+ | ${SED} -e 's/^/@dirrm /g'; \
+ done | ${SORT} -r >> ${ERLANG_PLIST}
+
+# Other directories.
+
+ @cd ${PREFIX}; ${FIND} lib/${ERLANG_LIB}/* -type d | ${SORT} -r \
+ | ${GREP} -v "^lib/${ERLANG_LIB}/man" \
+ | ${GREP} -v "^lib/${ERLANG_LIB}/lib" \
+ | ${SED} -e 's/^/@dirrm /g' \
+ >> ${ERLANG_PLIST}
+
+ @${ECHO_CMD} "r ${TMPPLIST}" > ${WRKDIR}/ex.script
+ @${ECHO_CMD} "/Insert PLIST here" >> ${WRKDIR}/ex.script
+ @${ECHO_CMD} "d" >> ${WRKDIR}/ex.script
+ @${ECHO_CMD} "r ${ERLANG_PLIST}" >> ${WRKDIR}/ex.script
+ @${ECHO_CMD} "x!" >> ${WRKDIR}/ex.script
+ @cd ${WRKDIR}; ex < ex.script
+ @${CAT} ${PKGMESSAGE}
+
+.include "Makefile.lib"
+.include "Makefile.man"
+
+.include <bsd.port.mk>
diff --git a/lang/erlang-runtime15/Makefile.lib b/lang/erlang-runtime15/Makefile.lib
new file mode 100644
index 000000000000..5a9f354ff599
--- /dev/null
+++ b/lang/erlang-runtime15/Makefile.lib
@@ -0,0 +1,59 @@
+# $FreeBSD$
+
+TOOLS_VSN= 2.6.8
+OTP_LIBS= appmon-2.1.14.1 \
+ asn1-1.8 \
+ common_test-1.6.3 \
+ compiler-4.8.2 \
+ cosEvent-2.1.12 \
+ cosEventDomain-1.1.12 \
+ cosFileTransfer-1.1.13 \
+ cosNotification-1.1.18 \
+ cosProperty-1.1.15 \
+ cosTime-1.1.12 \
+ cosTransactions-1.2.12 \
+ crypto-2.2 \
+ debugger-3.2.8 \
+ dialyzer-2.5.3 \
+ diameter-1.3 \
+ edoc-0.7.10 \
+ eldap-1.0 \
+ erl_docgen-0.3.3 \
+ erl_interface-3.7.9 \
+ erts-5.9.3.1 \
+ et-1.4.4.2 \
+ eunit-2.2.3 \
+ gs-1.5.15.1 \
+ hipe-3.9.3 \
+ ic-4.2.31 \
+ inets-5.9.2 \
+ inviso-0.6.3 \
+ jinterface-1.5.6 \
+ kernel-2.15.3 \
+ megaco-3.16.0.2 \
+ mnesia-4.7.1 \
+ observer-1.2 \
+ odbc-2.10.13 \
+ orber-3.6.24 \
+ os_mon-2.2.10 \
+ otp_mibs-1.0.7 \
+ parsetools-2.0.7 \
+ percept-0.8.7 \
+ pman-2.7.1.2 \
+ public_key-0.17 \
+ reltool-0.6.1 \
+ runtime_tools-1.8.9 \
+ sasl-2.2.1 \
+ snmp-4.22.1 \
+ ssh-2.1.2 \
+ ssl-5.1.2 \
+ stdlib-1.18.3 \
+ syntax_tools-1.6.9 \
+ test_server-3.5.3 \
+ toolbar-1.4.2.2 \
+ tools-2.6.8 \
+ tv-2.1.4.9 \
+ typer-0.9.4 \
+ webtool-0.8.9.1 \
+ wx-0.99.2 \
+ xmerl-1.3.2 \
diff --git a/lang/erlang-runtime15/Makefile.man b/lang/erlang-runtime15/Makefile.man
new file mode 100644
index 000000000000..32c7542883dc
--- /dev/null
+++ b/lang/erlang-runtime15/Makefile.man
@@ -0,0 +1,628 @@
+# $FreeBSD$
+
+MAN1= ct_run.1 \
+ diameter_compile.1 \
+ epmd.1 \
+ erl.1 \
+ erl_call.1 \
+ erlc.1 \
+ erlsrv.1 \
+ escript.1 \
+ run_erl.1 \
+ snmpc.1 \
+ start.1 \
+ start_erl.1 \
+ start_webtool.1 \
+ werl.1
+
+MAN3= CosEventChannelAdmin.3 \
+ CosEventChannelAdmin_ConsumerAdmin.3 \
+ CosEventChannelAdmin_EventChannel.3 \
+ CosEventChannelAdmin_ProxyPullConsumer.3 \
+ CosEventChannelAdmin_ProxyPullSupplier.3 \
+ CosEventChannelAdmin_ProxyPushConsumer.3 \
+ CosEventChannelAdmin_ProxyPushSupplier.3 \
+ CosEventChannelAdmin_SupplierAdmin.3 \
+ CosEventDomainAdmin.3 \
+ CosEventDomainAdmin_EventDomain.3 \
+ CosEventDomainAdmin_EventDomainFactory.3 \
+ CosFileTransfer_Directory.3 \
+ CosFileTransfer_File.3 \
+ CosFileTransfer_FileIterator.3 \
+ CosFileTransfer_FileTransferSession.3 \
+ CosFileTransfer_VirtualFileSystem.3 \
+ CosNaming.3 \
+ CosNaming_BindingIterator.3 \
+ CosNaming_NamingContext.3 \
+ CosNaming_NamingContextExt.3 \
+ CosNotification.3 \
+ CosNotification_AdminPropertiesAdmin.3 \
+ CosNotification_QoSAdmin.3 \
+ CosNotifyChannelAdmin_ConsumerAdmin.3 \
+ CosNotifyChannelAdmin_EventChannel.3 \
+ CosNotifyChannelAdmin_EventChannelFactory.3 \
+ CosNotifyChannelAdmin_ProxyConsumer.3 \
+ CosNotifyChannelAdmin_ProxyPullConsumer.3 \
+ CosNotifyChannelAdmin_ProxyPullSupplier.3 \
+ CosNotifyChannelAdmin_ProxyPushConsumer.3 \
+ CosNotifyChannelAdmin_ProxyPushSupplier.3 \
+ CosNotifyChannelAdmin_ProxySupplier.3 \
+ CosNotifyChannelAdmin_SequenceProxyPullConsumer.3 \
+ CosNotifyChannelAdmin_SequenceProxyPullSupplier.3 \
+ CosNotifyChannelAdmin_SequenceProxyPushConsumer.3 \
+ CosNotifyChannelAdmin_SequenceProxyPushSupplier.3 \
+ CosNotifyChannelAdmin_StructuredProxyPullConsumer.3 \
+ CosNotifyChannelAdmin_StructuredProxyPullSupplier.3 \
+ CosNotifyChannelAdmin_StructuredProxyPushConsumer.3 \
+ CosNotifyChannelAdmin_StructuredProxyPushSupplier.3 \
+ CosNotifyChannelAdmin_SupplierAdmin.3 \
+ CosNotifyComm_NotifyPublish.3 \
+ CosNotifyComm_NotifySubscribe.3 \
+ CosNotifyFilter_Filter.3 \
+ CosNotifyFilter_FilterAdmin.3 \
+ CosNotifyFilter_FilterFactory.3 \
+ CosNotifyFilter_MappingFilter.3 \
+ CosPropertyService_PropertiesIterator.3 \
+ CosPropertyService_PropertyNamesIterator.3 \
+ CosPropertyService_PropertySet.3 \
+ CosPropertyService_PropertySetDef.3 \
+ CosPropertyService_PropertySetDefFactory.3 \
+ CosPropertyService_PropertySetFactory.3 \
+ CosTime_TIO.3 \
+ CosTime_TimeService.3 \
+ CosTime_UTO.3 \
+ CosTimerEvent_TimerEventHandler.3 \
+ CosTimerEvent_TimerEventService.3 \
+ CosTransactions_Control.3 \
+ CosTransactions_Coordinator.3 \
+ CosTransactions_RecoveryCoordinator.3 \
+ CosTransactions_Resource.3 \
+ CosTransactions_SubtransactionAwareResource.3 \
+ CosTransactions_Terminator.3 \
+ CosTransactions_TransactionFactory.3 \
+ Module_Interface.3 \
+ alarm_handler.3 \
+ any.3 \
+ application.3 \
+ appmon.3 \
+ array.3 \
+ asn1ct.3 \
+ asn1rt.3 \
+ auth.3 \
+ base64.3 \
+ beam_lib.3 \
+ binary.3 \
+ c.3 \
+ calendar.3 \
+ code.3 \
+ compile.3 \
+ corba.3 \
+ corba_object.3 \
+ cosEventApp.3 \
+ cosEventDomainApp.3 \
+ cosFileTransferApp.3 \
+ cosNotificationApp.3 \
+ cosProperty.3 \
+ cosTime.3 \
+ cosTransactions.3 \
+ cover.3 \
+ cprof.3 \
+ cpu_sup.3 \
+ crashdump.3 \
+ crypto.3 \
+ ct.3 \
+ ct_cover.3 \
+ ct_ftp.3 \
+ ct_hooks.3 \
+ ct_master.3 \
+ ct_netconfc.3 \
+ ct_rpc.3 \
+ ct_slave.3 \
+ ct_snmp.3 \
+ ct_ssh.3 \
+ ct_telnet.3 \
+ dbg.3 \
+ debugger.3 \
+ dets.3 \
+ dialyzer.3 \
+ diameter.3 \
+ diameter_app.3 \
+ diameter_codec.3 \
+ diameter_make.3 \
+ diameter_sctp.3 \
+ diameter_tcp.3 \
+ diameter_transport.3 \
+ dict.3 \
+ digraph.3 \
+ digraph_utils.3 \
+ disk_log.3 \
+ disksup.3 \
+ driver_entry.3 \
+ dyntrace.3 \
+ edoc.3 \
+ edoc_doclet.3 \
+ edoc_extract.3 \
+ edoc_layout.3 \
+ edoc_lib.3 \
+ edoc_run.3 \
+ egd.3 \
+ ei.3 \
+ ei_connect.3 \
+ eldap.3 \
+ epp.3 \
+ epp_dodger.3 \
+ eprof.3 \
+ erl_boot_server.3 \
+ erl_comment_scan.3 \
+ erl_connect.3 \
+ erl_ddll.3 \
+ erl_driver.3 \
+ erl_error.3 \
+ erl_eterm.3 \
+ erl_eval.3 \
+ erl_expand_records.3 \
+ erl_format.3 \
+ erl_global.3 \
+ erl_id_trans.3 \
+ erl_internal.3 \
+ erl_lint.3 \
+ erl_malloc.3 \
+ erl_marshal.3 \
+ erl_nif.3 \
+ erl_parse.3 \
+ erl_pp.3 \
+ erl_prettypr.3 \
+ erl_prim_loader.3 \
+ erl_prim_loader_stub.3 \
+ erl_recomment.3 \
+ erl_scan.3 \
+ erl_set_memory_block.3 \
+ erl_syntax.3 \
+ erl_syntax_lib.3 \
+ erl_tar.3 \
+ erl_tidy.3 \
+ erlang.3 \
+ erlang_mode.3 \
+ erlang_stub.3 \
+ error_handler.3 \
+ error_logger.3 \
+ erts_alloc.3 \
+ erts_alloc_config.3 \
+ et.3 \
+ et_collector.3 \
+ et_selector.3 \
+ et_viewer.3 \
+ etop.3 \
+ ets.3 \
+ eunit.3 \
+ eunit_surefire.3 \
+ file.3 \
+ file_sorter.3 \
+ filelib.3 \
+ filename.3 \
+ fixed.3 \
+ fprof.3 \
+ ftp.3 \
+ gb_sets.3 \
+ gb_trees.3 \
+ gen_event.3 \
+ gen_fsm.3 \
+ gen_sctp.3 \
+ gen_server.3 \
+ gen_tcp.3 \
+ gen_udp.3 \
+ gl.3 \
+ global.3 \
+ global_group.3 \
+ glu.3 \
+ gs.3 \
+ heart.3 \
+ http_uri.3 \
+ httpc.3 \
+ httpd.3 \
+ httpd_conf.3 \
+ httpd_socket.3 \
+ httpd_util.3 \
+ i.3 \
+ ic.3 \
+ ic_c_protocol.3 \
+ ic_clib.3 \
+ igor.3 \
+ inet.3 \
+ inet_res.3 \
+ inets.3 \
+ init.3 \
+ init_stub.3 \
+ instrument.3 \
+ int.3 \
+ interceptors.3 \
+ inviso.3 \
+ inviso_as_lib.3 \
+ inviso_lfm.3 \
+ inviso_lfm_tpfreader.3 \
+ inviso_rt.3 \
+ inviso_rt_meta.3 \
+ io.3 \
+ io_lib.3 \
+ lcnt.3 \
+ leex.3 \
+ lib.3 \
+ lists.3 \
+ lname.3 \
+ lname_component.3 \
+ log_mf_h.3 \
+ make.3 \
+ math.3 \
+ megaco.3 \
+ megaco_codec_meas.3 \
+ megaco_codec_mstone1.3 \
+ megaco_codec_mstone2.3 \
+ megaco_codec_transform.3 \
+ megaco_edist_compress.3 \
+ megaco_encoder.3 \
+ megaco_flex_scanner.3 \
+ megaco_tcp.3 \
+ megaco_transport.3 \
+ megaco_udp.3 \
+ megaco_user.3 \
+ memsup.3 \
+ mnesia.3 \
+ mnesia_frag_hash.3 \
+ mnesia_registry.3 \
+ mod_alias.3 \
+ mod_auth.3 \
+ mod_esi.3 \
+ mod_security.3 \
+ ms_transform.3 \
+ net_adm.3 \
+ net_kernel.3 \
+ nteventlog.3 \
+ observer.3 \
+ odbc.3 \
+ orber.3 \
+ orber_acl.3 \
+ orber_diagnostics.3 \
+ orber_ifr.3 \
+ orber_tc.3 \
+ orddict.3 \
+ ordsets.3 \
+ os.3 \
+ os_mon_mib.3 \
+ os_sup.3 \
+ otp_mib.3 \
+ overload.3 \
+ packages.3 \
+ percept.3 \
+ percept_profile.3 \
+ pg.3 \
+ pg2.3 \
+ pman.3 \
+ pool.3 \
+ prettypr.3 \
+ proc_lib.3 \
+ proplists.3 \
+ public_key.3 \
+ qlc.3 \
+ queue.3 \
+ random.3 \
+ rb.3 \
+ re.3 \
+ registry.3 \
+ release_handler.3 \
+ reltool.3 \
+ rpc.3 \
+ seq_trace.3 \
+ sets.3 \
+ shell.3 \
+ shell_default.3 \
+ slave.3 \
+ snmp.3 \
+ snmp_community_mib.3 \
+ snmp_framework_mib.3 \
+ snmp_generic.3 \
+ snmp_index.3 \
+ snmp_notification_mib.3 \
+ snmp_pdus.3 \
+ snmp_standard_mib.3 \
+ snmp_target_mib.3 \
+ snmp_user_based_sm_mib.3 \
+ snmp_view_based_acm_mib.3 \
+ snmpa.3 \
+ snmpa_conf.3 \
+ snmpa_discovery_handler.3 \
+ snmpa_error.3 \
+ snmpa_error_io.3 \
+ snmpa_error_logger.3 \
+ snmpa_error_report.3 \
+ snmpa_local_db.3 \
+ snmpa_mpd.3 \
+ snmpa_network_interface.3 \
+ snmpa_network_interface_filter.3 \
+ snmpa_notification_delivery_info_receiver.3 \
+ snmpa_notification_filter.3 \
+ snmpa_supervisor.3 \
+ snmpc.3 \
+ snmpm.3 \
+ snmpm_conf.3 \
+ snmpm_mpd.3 \
+ snmpm_network_interface.3 \
+ snmpm_network_interface_filter.3 \
+ snmpm_user.3 \
+ sofs.3 \
+ ssh.3 \
+ ssh_channel.3 \
+ ssh_connection.3 \
+ ssh_sftp.3 \
+ ssh_sftpd.3 \
+ ssl.3 \
+ ssl_session_cache_api.3 \
+ string.3 \
+ supervisor.3 \
+ supervisor_bridge.3 \
+ sys.3 \
+ systools.3 \
+ tags.3 \
+ test_server.3 \
+ test_server_ctrl.3 \
+ tftp.3 \
+ timer.3 \
+ toolbar.3 \
+ ttb.3 \
+ tv.3 \
+ unicode.3 \
+ unix_telnet.3 \
+ user.3 \
+ webtool.3 \
+ win32reg.3 \
+ wrap_log_reader.3 \
+ wx.3 \
+ wxAcceleratorEntry.3 \
+ wxAcceleratorTable.3 \
+ wxArtProvider.3 \
+ wxAuiDockArt.3 \
+ wxAuiManager.3 \
+ wxAuiManagerEvent.3 \
+ wxAuiNotebook.3 \
+ wxAuiNotebookEvent.3 \
+ wxAuiPaneInfo.3 \
+ wxAuiTabArt.3 \
+ wxBitmap.3 \
+ wxBitmapButton.3 \
+ wxBitmapDataObject.3 \
+ wxBoxSizer.3 \
+ wxBrush.3 \
+ wxBufferedDC.3 \
+ wxBufferedPaintDC.3 \
+ wxButton.3 \
+ wxCalendarCtrl.3 \
+ wxCalendarDateAttr.3 \
+ wxCalendarEvent.3 \
+ wxCaret.3 \
+ wxCheckBox.3 \
+ wxCheckListBox.3 \
+ wxChildFocusEvent.3 \
+ wxChoice.3 \
+ wxChoicebook.3 \
+ wxClientDC.3 \
+ wxClipboard.3 \
+ wxCloseEvent.3 \
+ wxColourData.3 \
+ wxColourDialog.3 \
+ wxColourPickerCtrl.3 \
+ wxColourPickerEvent.3 \
+ wxComboBox.3 \
+ wxCommandEvent.3 \
+ wxContextMenuEvent.3 \
+ wxControl.3 \
+ wxControlWithItems.3 \
+ wxCursor.3 \
+ wxDC.3 \
+ wxDataObject.3 \
+ wxDateEvent.3 \
+ wxDatePickerCtrl.3 \
+ wxDialog.3 \
+ wxDirDialog.3 \
+ wxDirPickerCtrl.3 \
+ wxDisplayChangedEvent.3 \
+ wxEraseEvent.3 \
+ wxEvent.3 \
+ wxEvtHandler.3 \
+ wxFileDataObject.3 \
+ wxFileDialog.3 \
+ wxFileDirPickerEvent.3 \
+ wxFilePickerCtrl.3 \
+ wxFindReplaceData.3 \
+ wxFindReplaceDialog.3 \
+ wxFlexGridSizer.3 \
+ wxFocusEvent.3 \
+ wxFont.3 \
+ wxFontData.3 \
+ wxFontDialog.3 \
+ wxFontPickerCtrl.3 \
+ wxFontPickerEvent.3 \
+ wxFrame.3 \
+ wxGBSizerItem.3 \
+ wxGLCanvas.3 \
+ wxGauge.3 \
+ wxGenericDirCtrl.3 \
+ wxGraphicsBrush.3 \
+ wxGraphicsContext.3 \
+ wxGraphicsFont.3 \
+ wxGraphicsMatrix.3 \
+ wxGraphicsObject.3 \
+ wxGraphicsPath.3 \
+ wxGraphicsPen.3 \
+ wxGraphicsRenderer.3 \
+ wxGrid.3 \
+ wxGridBagSizer.3 \
+ wxGridCellAttr.3 \
+ wxGridCellBoolEditor.3 \
+ wxGridCellBoolRenderer.3 \
+ wxGridCellChoiceEditor.3 \
+ wxGridCellEditor.3 \
+ wxGridCellFloatEditor.3 \
+ wxGridCellFloatRenderer.3 \
+ wxGridCellNumberEditor.3 \
+ wxGridCellNumberRenderer.3 \
+ wxGridCellRenderer.3 \
+ wxGridCellStringRenderer.3 \
+ wxGridCellTextEditor.3 \
+ wxGridEvent.3 \
+ wxGridSizer.3 \
+ wxHelpEvent.3 \
+ wxHtmlEasyPrinting.3 \
+ wxHtmlLinkEvent.3 \
+ wxHtmlWindow.3 \
+ wxIcon.3 \
+ wxIconBundle.3 \
+ wxIconizeEvent.3 \
+ wxIdleEvent.3 \
+ wxImage.3 \
+ wxImageList.3 \
+ wxJoystickEvent.3 \
+ wxKeyEvent.3 \
+ wxLayoutAlgorithm.3 \
+ wxListBox.3 \
+ wxListCtrl.3 \
+ wxListEvent.3 \
+ wxListItem.3 \
+ wxListItemAttr.3 \
+ wxListView.3 \
+ wxListbook.3 \
+ wxLogNull.3 \
+ wxMDIChildFrame.3 \
+ wxMDIClientWindow.3 \
+ wxMDIParentFrame.3 \
+ wxMask.3 \
+ wxMaximizeEvent.3 \
+ wxMemoryDC.3 \
+ wxMenu.3 \
+ wxMenuBar.3 \
+ wxMenuEvent.3 \
+ wxMenuItem.3 \
+ wxMessageDialog.3 \
+ wxMiniFrame.3 \
+ wxMirrorDC.3 \
+ wxMouseCaptureChangedEvent.3 \
+ wxMouseEvent.3 \
+ wxMoveEvent.3 \
+ wxMultiChoiceDialog.3 \
+ wxNavigationKeyEvent.3 \
+ wxNcPaintEvent.3 \
+ wxNotebook.3 \
+ wxNotebookEvent.3 \
+ wxNotifyEvent.3 \
+ wxPageSetupDialog.3 \
+ wxPageSetupDialogData.3 \
+ wxPaintDC.3 \
+ wxPaintEvent.3 \
+ wxPalette.3 \
+ wxPaletteChangedEvent.3 \
+ wxPanel.3 \
+ wxPasswordEntryDialog.3 \
+ wxPen.3 \
+ wxPickerBase.3 \
+ wxPostScriptDC.3 \
+ wxPreviewCanvas.3 \
+ wxPreviewControlBar.3 \
+ wxPreviewFrame.3 \
+ wxPrintData.3 \
+ wxPrintDialog.3 \
+ wxPrintDialogData.3 \
+ wxPrintPreview.3 \
+ wxPrinter.3 \
+ wxPrintout.3 \
+ wxProgressDialog.3 \
+ wxQueryNewPaletteEvent.3 \
+ wxRadioBox.3 \
+ wxRadioButton.3 \
+ wxRegion.3 \
+ wxSashEvent.3 \
+ wxSashLayoutWindow.3 \
+ wxSashWindow.3 \
+ wxScreenDC.3 \
+ wxScrollBar.3 \
+ wxScrollEvent.3 \
+ wxScrollWinEvent.3 \
+ wxScrolledWindow.3 \
+ wxSetCursorEvent.3 \
+ wxShowEvent.3 \
+ wxSingleChoiceDialog.3 \
+ wxSizeEvent.3 \
+ wxSizer.3 \
+ wxSizerFlags.3 \
+ wxSizerItem.3 \
+ wxSlider.3 \
+ wxSpinButton.3 \
+ wxSpinCtrl.3 \
+ wxSpinEvent.3 \
+ wxSplashScreen.3 \
+ wxSplitterEvent.3 \
+ wxSplitterWindow.3 \
+ wxStaticBitmap.3 \
+ wxStaticBox.3 \
+ wxStaticBoxSizer.3 \
+ wxStaticLine.3 \
+ wxStaticText.3 \
+ wxStatusBar.3 \
+ wxStdDialogButtonSizer.3 \
+ wxStyledTextCtrl.3 \
+ wxStyledTextEvent.3 \
+ wxSysColourChangedEvent.3 \
+ wxSystemOptions.3 \
+ wxSystemSettings.3 \
+ wxTaskBarIcon.3 \
+ wxTaskBarIconEvent.3 \
+ wxTextAttr.3 \
+ wxTextCtrl.3 \
+ wxTextDataObject.3 \
+ wxTextEntryDialog.3 \
+ wxToggleButton.3 \
+ wxToolBar.3 \
+ wxToolTip.3 \
+ wxToolbook.3 \
+ wxTopLevelWindow.3 \
+ wxTreeCtrl.3 \
+ wxTreeEvent.3 \
+ wxTreebook.3 \
+ wxUpdateUIEvent.3 \
+ wxWindow.3 \
+ wxWindowCreateEvent.3 \
+ wxWindowDC.3 \
+ wxWindowDestroyEvent.3 \
+ wxXmlResource.3 \
+ wx_misc.3 \
+ wx_object.3 \
+ xmerl.3 \
+ xmerl_eventp.3 \
+ xmerl_sax_parser.3 \
+ xmerl_scan.3 \
+ xmerl_xpath.3 \
+ xmerl_xs.3 \
+ xmerl_xsd.3 \
+ xref.3 \
+ yecc.3 \
+ zip.3 \
+ zlib.3 \
+ zlib_stub.3
+
+MAN4= app.4 \
+ appup.4 \
+ config.4 \
+ diameter_dict.4 \
+ rel.4 \
+ relup.4 \
+ script.4
+
+MAN6= common_test.6 \
+ crypto.6 \
+ erl_docgen.6 \
+ kernel.6 \
+ observer.6 \
+ os_mon.6 \
+ runtime_tools.6 \
+ sasl.6 \
+ snmp.6 \
+ ssl.6 \
+ stdlib.6 \
+ test_server.6
diff --git a/lang/erlang-runtime15/distinfo b/lang/erlang-runtime15/distinfo
new file mode 100644
index 000000000000..c6cbb2046bcd
--- /dev/null
+++ b/lang/erlang-runtime15/distinfo
@@ -0,0 +1,18 @@
+SHA256 (erlang/otp_src_R15B03-1.tar.gz) = 4bccac86dd76aec050252e44276a0283a0df9218e6470cf042a9b9f9dfc9476c
+SIZE (erlang/otp_src_R15B03-1.tar.gz) = 76123810
+SHA256 (erlang/otp_doc_man_R15B03-1.tar.gz) = 07980d8014c7cf8194b7078c137353f5083992add4663ced3dcba2ff91f228d8
+SIZE (erlang/otp_doc_man_R15B03-1.tar.gz) = 1305001
+SHA256 (erlang/otp_doc_html_R15B03-1.tar.gz) = d06f580f11d1303217a5c1cf8d68a98d7e01c535be934dcd430ecdc254f7572e
+SIZE (erlang/otp_doc_html_R15B03-1.tar.gz) = 30436303
+SHA256 (erlang/armstrong_thesis_2003.pdf) = da585b914eb07350e2d6f727db5eb0fb1551f49fc1270f7d4dc079f2c8c1ab7a
+SIZE (erlang/armstrong_thesis_2003.pdf) = 859249
+SHA256 (erlang/bjarnelic.pdf) = 9544d4af5cea324e5c9cf77e670d9561ad61ddc240cdb5c2afecebc0a3d7429b
+SIZE (erlang/bjarnelic.pdf) = 488043
+SHA256 (erlang/erlang-book-part1.pdf) = ef2fb9d15d35f3b1b602c8578e48618597477f9cfab2d103dc2e22372c46ca0a
+SIZE (erlang/erlang-book-part1.pdf) = 883639
+SHA256 (erlang/master_thesis_patterns.pdf) = b390fd59060fb944c78bceed781c7ad3795d4f9fbe86d391bccc479828552b43
+SIZE (erlang/master_thesis_patterns.pdf) = 422457
+SHA256 (erlang/mnesia_overview.pdf) = f07f9edd4ba865a1c50647dd6fa4a8f49277f8f3bef4d521c06fd90293717032
+SIZE (erlang/mnesia_overview.pdf) = 150266
+SHA256 (erlang/programming_rules.pdf) = b95f8851004832b044e064c12976a422613ece897e98308a27ee8b66738b4502
+SIZE (erlang/programming_rules.pdf) = 77025
diff --git a/lang/erlang-runtime15/files/epmd.in b/lang/erlang-runtime15/files/epmd.in
new file mode 100644
index 000000000000..acf9c58443bd
--- /dev/null
+++ b/lang/erlang-runtime15/files/epmd.in
@@ -0,0 +1,25 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+# PROVIDE: epmd
+# REQUIRE: LOGIN
+#
+# Add the following line to /etc/rc.conf to enable epmd:
+#
+# epmd_enable="YES"
+#
+
+epmd_enable=${epmd_enable:-"NO"}
+
+. /etc/rc.subr
+
+name=epmd
+rcvar=epmd_enable
+
+procname=%%PREFIX%%/bin/epmd
+start_cmd="%%PREFIX%%/bin/epmd -daemon"
+stop_cmd="%%PREFIX%%/bin/epmd -kill >/dev/null"
+
+load_rc_config ${name}
+run_rc_command "$1"
diff --git a/lang/erlang-runtime15/files/patch-Makefile.in b/lang/erlang-runtime15/files/patch-Makefile.in
new file mode 100644
index 000000000000..06f40ced0395
--- /dev/null
+++ b/lang/erlang-runtime15/files/patch-Makefile.in
@@ -0,0 +1,23 @@
+
+$FreeBSD$
+
+--- Makefile.in.orig
++++ Makefile.in
+@@ -56,7 +56,7 @@
+ libdir = @libdir@
+
+ # Where Erlang/OTP is located
+-libdir_suffix = /erlang
++libdir_suffix = /erlang15
+ erlang_libdir = $(libdir)$(libdir_suffix)
+ erlang_bindir = $(erlang_libdir)/bin
+
+@@ -913,7 +913,7 @@
+ #
+ # Order is important here, don't change it!
+ #
+-INST_DEP += install.dirs install.emulator install.libs install.Install install.bin
++INST_DEP += install.dirs install.emulator install.libs install.Install
+
+ install: $(INST_DEP)
+
diff --git a/lang/erlang-runtime15/files/patch-erts-emulator-Makefile.in b/lang/erlang-runtime15/files/patch-erts-emulator-Makefile.in
new file mode 100644
index 000000000000..02371ab44deb
--- /dev/null
+++ b/lang/erlang-runtime15/files/patch-erts-emulator-Makefile.in
@@ -0,0 +1,14 @@
+
+$FreeBSD$
+
+--- erts/emulator/Makefile.in.orig
++++ erts/emulator/Makefile.in
+@@ -544,7 +546,7 @@
+ endif
+
+ $(OBJDIR)/%.o: beam/%.c
+- $(CC) $(subst -O2, $(GEN_OPT_FLGS), $(CFLAGS)) $(INCLUDES) -c $< -o $@
++ $(CC) $(INCLUDES) $(subst -O2, $(GEN_OPT_FLGS), $(CFLAGS)) -c $< -o $@
+
+ else
+
diff --git a/lang/erlang-runtime15/files/patch-erts_emulator_drivers_common_efile__drv.c b/lang/erlang-runtime15/files/patch-erts_emulator_drivers_common_efile__drv.c
new file mode 100644
index 000000000000..dedf69150029
--- /dev/null
+++ b/lang/erlang-runtime15/files/patch-erts_emulator_drivers_common_efile__drv.c
@@ -0,0 +1,337 @@
+
+$FreeBSD$
+
+--- erts/emulator/drivers/common/efile_drv.c.orig
++++ erts/emulator/drivers/common/efile_drv.c
+@@ -311,6 +311,18 @@
+ unsigned flags; /* Original flags from FILE_OPEN. */
+ void (*invoke)(void *);
+ struct t_data *d;
++ /*
++ * If an operation against a compressed file is being executed
++ * by an async thread, ensure the stop callback doesn't close
++ * the fd (gzFile) while the async thread doesn't finish using
++ * the fd (gzFile) - otherwise it accesses a dangling pointer.
++ * The following comp_op_* variables are used to coordinate the
++ * driver stop callback with the ongoing async operation.
++ */
++ int comp_op_in_progress;
++ volatile int comp_op_done;
++ erts_mtx_t comp_op_mtx;
++ erts_cnd_t comp_op_cnd;
+ void (*free)(void *);
+ struct t_data *cq_head; /* Queue of incoming commands */
+ struct t_data *cq_tail; /* -""- */
+@@ -426,6 +438,9 @@
+ struct t_data *next;
+ int command;
+ int level;
++ int volatile *comp_op_done;
++ erts_mtx_t *comp_op_mtx;
++ erts_cnd_t *comp_op_cnd;
+ void (*invoke)(void *);
+ void (*free)(void *);
+ int again;
+@@ -714,6 +729,14 @@
+ return d;
+ }
+
++static void signal_comp_op_done(struct t_data *d) {
++ if (d->comp_op_done != NULL) {
++ erts_mtx_lock(d->comp_op_mtx);
++ *(d->comp_op_done) = 1;
++ erts_cnd_signal(d->comp_op_cnd);
++ erts_mtx_unlock(d->comp_op_mtx);
++ }
++}
+
+ /*********************************************************************
+ * Driver entry point -> init
+@@ -757,6 +780,8 @@
+ desc->key = (unsigned int) (UWord) port;
+ desc->flags = 0;
+ desc->invoke = NULL;
++ desc->comp_op_in_progress = 0;
++ desc->comp_op_done = 0;
+ desc->d = NULL;
+ desc->free = NULL;
+ desc->cq_head = NULL;
+@@ -800,6 +825,7 @@
+ DTRACE_INVOKE_SETUP(FILE_CLOSE);
+ d->again = 0;
+ do_close(d->flags, d->fd);
++ signal_comp_op_done(d);
+ DTRACE_INVOKE_RETURN(FILE_CLOSE);
+ }
+
+@@ -814,9 +840,20 @@
+ TRACE_C('p');
+
+ if (desc->fd != FILE_FD_INVALID) {
++ if (desc->comp_op_in_progress) {
++ erts_mtx_lock(&desc->comp_op_mtx);
++ while (!desc->comp_op_done) {
++ erts_cnd_wait(&desc->comp_op_cnd, &desc->comp_op_mtx);
++ }
++ erts_mtx_unlock(&desc->comp_op_mtx);
++ }
+ do_close(desc->flags, desc->fd);
+ desc->fd = FILE_FD_INVALID;
+ desc->flags = 0;
++ if (sys_info.async_threads > 0 && (desc->flags & EFILE_COMPRESSED)) {
++ erts_cnd_destroy(&desc->comp_op_cnd);
++ erts_mtx_destroy(&desc->comp_op_mtx);
++ }
+ }
+ if (desc->read_binp) {
+ driver_free_binary(desc->read_binp);
+@@ -1032,6 +1069,7 @@
+ {
+ DTRACE_INVOKE_SETUP_BY_NAME(FILE_MKDIR);
+ invoke_name(data, efile_mkdir);
++ signal_comp_op_done((struct t_data *) data);
+ DTRACE_INVOKE_RETURN(FILE_MKDIR);
+ }
+
+@@ -1039,6 +1077,7 @@
+ {
+ DTRACE_INVOKE_SETUP_BY_NAME(FILE_RMDIR);
+ invoke_name(data, efile_rmdir);
++ signal_comp_op_done((struct t_data *) data);
+ DTRACE_INVOKE_RETURN(FILE_RMDIR);
+ }
+
+@@ -1046,6 +1085,7 @@
+ {
+ DTRACE_INVOKE_SETUP_BY_NAME(FILE_DELETE);
+ invoke_name(data, efile_delete_file);
++ signal_comp_op_done((struct t_data *) data);
+ DTRACE_INVOKE_RETURN(FILE_DELETE);
+ }
+
+@@ -1053,6 +1093,7 @@
+ {
+ DTRACE_INVOKE_SETUP_BY_NAME(FILE_CHDIR);
+ invoke_name(data, efile_chdir);
++ signal_comp_op_done((struct t_data *) data);
+ DTRACE_INVOKE_RETURN(FILE_CHDIR);
+ }
+
+@@ -1064,6 +1105,7 @@
+
+ d->again = 0;
+ d->result_ok = efile_fdatasync(&d->errInfo, fd);
++ signal_comp_op_done(d);
+ DTRACE_INVOKE_RETURN(FILE_FDATASYNC);
+ }
+
+@@ -1075,6 +1117,7 @@
+
+ d->again = 0;
+ d->result_ok = efile_fsync(&d->errInfo, fd);
++ signal_comp_op_done(d);
+ DTRACE_INVOKE_RETURN(FILE_FSYNC);
+ }
+
+@@ -1086,6 +1129,7 @@
+
+ d->again = 0;
+ d->result_ok = efile_truncate_file(&d->errInfo, &fd, d->flags);
++ signal_comp_op_done(d);
+ DTRACE_INVOKE_RETURN(FILE_TRUNCATE);
+ }
+
+@@ -1129,6 +1173,7 @@
+ } else {
+ d->again = 0;
+ }
++ signal_comp_op_done(d);
+ DTRACE_INVOKE_RETURN(FILE_READ);
+ }
+
+@@ -1238,6 +1283,7 @@
+ break;
+ }
+ } while (local_loop);
++ signal_comp_op_done(d);
+ DTRACE_INVOKE_RETURN(FILE_READ_LINE);
+ }
+
+@@ -1298,6 +1344,7 @@
+ done:
+ d->again = 0;
+ chop_done:
++ signal_comp_op_done(d);
+ DTRACE_INVOKE_RETURN(FILE_READ_FILE);
+ }
+
+@@ -1363,6 +1410,7 @@
+ }
+ d->again = 0;
+ done:
++ signal_comp_op_done(d);
+ DTRACE_INVOKE_RETURN(FILE_PREADV);
+ }
+
+@@ -1434,6 +1482,7 @@
+ done:
+ d->result_ok = !0;
+ d->again = 0;
++ signal_comp_op_done(d);
+ DTRACE_INVOKE_RETURN(FILE_IPREAD);
+ }
+
+@@ -1531,6 +1580,7 @@
+ TRACE_F(("w%lu", (unsigned long)size));
+
+ }
++ signal_comp_op_done(d);
+ DTRACE_INVOKE_RETURN(FILE_WRITE);
+ }
+
+@@ -1550,6 +1600,7 @@
+ d->again = 0;
+ d->result_ok = efile_getdcwd(&d->errInfo,d->drive, d->b+1,
+ RESBUFSIZE-1);
++ signal_comp_op_done(d);
+ DTRACE_INVOKE_RETURN(FILE_PWD);
+ }
+
+@@ -1564,6 +1615,7 @@
+ RESBUFSIZE-1);
+ if (d->result_ok != 0)
+ FILENAME_COPY((char *) d->b + 1, resbuf+1);
++ signal_comp_op_done(d);
+ DTRACE_INVOKE_RETURN(FILE_READLINK);
+ }
+
+@@ -1578,6 +1630,7 @@
+ RESBUFSIZE-1);
+ if (d->result_ok != 0)
+ FILENAME_COPY((char *) d->b + 1, resbuf+1);
++ signal_comp_op_done(d);
+ DTRACE_INVOKE_RETURN(FILE_ALTNAME);
+ }
+
+@@ -1670,6 +1723,7 @@
+ }
+ }
+ done:
++ signal_comp_op_done(d);
+ EF_FREE(iov); /* Free our copy of the vector, nothing to restore */
+ DTRACE_INVOKE_RETURN(FILE_PWRITEV);
+ }
+@@ -1695,6 +1749,7 @@
+ DTRACE3(efile_drv_int_entry, d->sched_i1, d->sched_i2,
+ d->command == FILE_LSTAT ? FILE_LSTAT : FILE_FSTAT);
+ gcc_optimizer_hack++;
++ signal_comp_op_done(d);
+ }
+
+ static void invoke_link(void *data)
+@@ -1707,6 +1762,7 @@
+ d->again = 0;
+ new_name = name+FILENAME_BYTELEN(name)+FILENAME_CHARSIZE;
+ d->result_ok = efile_link(&d->errInfo, name, new_name);
++ signal_comp_op_done(d);
+ DTRACE_INVOKE_RETURN(FILE_LINK);
+ }
+
+@@ -1720,6 +1776,7 @@
+ d->again = 0;
+ new_name = name+FILENAME_BYTELEN(name)+FILENAME_CHARSIZE;
+ d->result_ok = efile_symlink(&d->errInfo, name, new_name);
++ signal_comp_op_done(d);
+ DTRACE_INVOKE_RETURN(FILE_SYMLINK);
+ }
+
+@@ -1733,6 +1790,7 @@
+ d->again = 0;
+ new_name = name+FILENAME_BYTELEN(name)+FILENAME_CHARSIZE;
+ d->result_ok = efile_rename(&d->errInfo, name, new_name);
++ signal_comp_op_done(d);
+ DTRACE_INVOKE_RETURN(FILE_RENAME);
+ }
+
+@@ -1743,6 +1801,7 @@
+
+ d->again = 0;
+ d->result_ok = efile_write_info(&d->errInfo, &d->info, d->b);
++ signal_comp_op_done(d);
+ DTRACE_INVOKE_RETURN(FILE_WRITE_INFO);
+ }
+
+@@ -1775,6 +1834,7 @@
+ &d->c.lseek.location);
+ }
+ d->result_ok = status;
++ signal_comp_op_done(d);
+ DTRACE_INVOKE_RETURN(FILE_LSEEK);
+ }
+
+@@ -1822,6 +1882,7 @@
+ } while(res);
+
+ d->result_ok = (d->errInfo.posix_errno == 0);
++ signal_comp_op_done(d);
+ DTRACE_INVOKE_RETURN(FILE_READDIR);
+ }
+
+@@ -1876,6 +1937,7 @@
+
+ d->again = 0;
+ d->result_ok = efile_fadvise(&d->errInfo, fd, offset, length, advise);
++ signal_comp_op_done(d);
+ DTRACE_INVOKE_RETURN(FILE_FADVISE);
+ }
+
+@@ -1906,6 +1968,7 @@
+ } else {
+ d->result_ok = -1;
+ }
++ signal_comp_op_done(d);
+ }
+
+ static void free_sendfile(void *data) {
+@@ -2023,6 +2086,21 @@
+ return;
+ TRACE_F(("x%i", (int) d->command));
+ d->again = sys_info.async_threads == 0;
++
++ if ((desc->flags & EFILE_COMPRESSED) && (sys_info.async_threads > 0) &&
++ (desc->fd != FILE_FD_INVALID)) {
++
++ desc->comp_op_in_progress = 1;
++ desc->comp_op_done = 0;
++ d->comp_op_done = &desc->comp_op_done;
++ d->comp_op_mtx = &desc->comp_op_mtx;
++ d->comp_op_cnd = &desc->comp_op_cnd;
++ } else {
++ d->comp_op_done = NULL;
++ d->comp_op_mtx = NULL;
++ d->comp_op_cnd = NULL;
++ }
++
+ DRIVER_ASYNC(d->level, desc, d->invoke, void_ptr=d, d->free);
+ }
+
+@@ -2247,6 +2325,8 @@
+ return;
+ }
+
++ desc->comp_op_in_progress = 0;
++
+ switch (d->command)
+ {
+ case FILE_READ:
+@@ -2375,6 +2455,10 @@
+ } else {
+ desc->fd = d->fd;
+ desc->flags = d->flags;
++ if (sys_info.async_threads > 0 && (desc->flags & EFILE_COMPRESSED)) {
++ erts_mtx_init(&desc->comp_op_mtx, "efile_drv comp op mutex");
++ erts_cnd_init(&desc->comp_op_cnd);
++ }
+ reply_Uint(desc, d->fd);
+ }
+ free_data(data);
diff --git a/lang/erlang-runtime15/files/patch-erts_etc_common_erlc.c b/lang/erlang-runtime15/files/patch-erts_etc_common_erlc.c
new file mode 100644
index 000000000000..ae65f91225ca
--- /dev/null
+++ b/lang/erlang-runtime15/files/patch-erts_etc_common_erlc.c
@@ -0,0 +1,13 @@
+
+$FreeBSD$
+
+--- erts/etc/common/erlc.c.orig
++++ erts/etc/common/erlc.c
+@@ -186,6 +186,7 @@
+ */
+
+ PUSH("-noinput");
++ PUSH2("-smp", "disable");
+ PUSH2("-mode", "minimal");
+ PUSH2("-boot", "start_clean");
+ PUSH3("-s", "erl_compile", "compile_cmdline");
diff --git a/lang/erlang-runtime15/files/patch-erts_etc_unix_run__erl.c b/lang/erlang-runtime15/files/patch-erts_etc_unix_run__erl.c
new file mode 100644
index 000000000000..451b3c3e66fe
--- /dev/null
+++ b/lang/erlang-runtime15/files/patch-erts_etc_unix_run__erl.c
@@ -0,0 +1,15 @@
+
+$FreeBSD$
+
+--- erts/etc/unix/run_erl.c.orig
++++ erts/etc/unix/run_erl.c
+@@ -69,9 +69,6 @@
+ #ifdef HAVE_UTMP_H
+ # include <utmp.h>
+ #endif
+-#ifdef HAVE_UTIL_H
+-# include <util.h>
+-#endif
+ #ifdef HAVE_SYS_IOCTL_H
+ # include <sys/ioctl.h>
+ #endif
diff --git a/lang/erlang-runtime15/files/patch-lib_erl__interface_src_connect_ei__resolve.c b/lang/erlang-runtime15/files/patch-lib_erl__interface_src_connect_ei__resolve.c
new file mode 100644
index 000000000000..d8454c710f69
--- /dev/null
+++ b/lang/erlang-runtime15/files/patch-lib_erl__interface_src_connect_ei__resolve.c
@@ -0,0 +1,15 @@
+
+$FreeBSD$
+
+--- lib/erl_interface/src/connect/ei_resolve.c.orig
++++ lib/erl_interface/src/connect/ei_resolve.c
+@@ -621,7 +621,8 @@
+
+ return result;
+ #else
+- return gethostbyname_r(name,hostp,buffer,buflen,h_errnop);
++ struct hostent *dummy;
++ return gethostbyname_r(name,hostp,buffer,buflen,&dummy,h_errnop);
+ #endif
+ #endif
+ #endif
diff --git a/lang/erlang-runtime15/files/patch-lib_et_src_et__gs__contents__viewer.erl b/lang/erlang-runtime15/files/patch-lib_et_src_et__gs__contents__viewer.erl
new file mode 100644
index 000000000000..a747941fac91
--- /dev/null
+++ b/lang/erlang-runtime15/files/patch-lib_et_src_et__gs__contents__viewer.erl
@@ -0,0 +1,13 @@
+
+$FreeBSD$
+
+--- lib/et/src/et_gs_contents_viewer.erl.orig 2010-03-11 16:24:41.000000000 +0800
++++ lib/et/src/et_gs_contents_viewer.erl 2010-03-11 16:24:53.000000000 +0800
+@@ -347,7 +347,6 @@ handle_info({gs, _Obj, keypress, _, [Key
+ 'Caps_Lock' ->
+ {noreply, S};
+ _ ->
+- io:format("~p: ignored: ~p~n", [?MODULE, KeySym]),
+ {noreply, S}
+ end;
+ handle_info({gs, _Obj, configure, [], [W, H | _]}, S) ->
diff --git a/lang/erlang-runtime15/files/patch-lib_et_src_et__gs__viewer.erl b/lang/erlang-runtime15/files/patch-lib_et_src_et__gs__viewer.erl
new file mode 100644
index 000000000000..8f0fe420eae5
--- /dev/null
+++ b/lang/erlang-runtime15/files/patch-lib_et_src_et__gs__viewer.erl
@@ -0,0 +1,15 @@
+
+$FreeBSD$
+
+--- lib/et/src/et_gs_viewer.erl.orig 2010-03-11 16:26:59.000000000 +0800
++++ lib/et/src/et_gs_viewer.erl 2010-03-11 16:27:16.000000000 +0800
+@@ -855,8 +855,7 @@ close_all_others(S) ->
+ noreply(S).
+
+ click_error(Click, S) ->
+- gs:config(S#state.canvas, beep),
+- io:format("~p: ignored: ~p~n", [?MODULE, Click]).
++ gs:config(S#state.canvas, beep).
+
+ %%%----------------------------------------------------------------------
+ %%% Clone viewer
diff --git a/lang/erlang-runtime15/files/patch-lib_gs_src_tool__utils.erl b/lang/erlang-runtime15/files/patch-lib_gs_src_tool__utils.erl
new file mode 100644
index 000000000000..1a44ce423f9d
--- /dev/null
+++ b/lang/erlang-runtime15/files/patch-lib_gs_src_tool__utils.erl
@@ -0,0 +1,87 @@
+
+$FreeBSD$
+
+--- lib/gs/src/tool_utils.erl.orig
++++ lib/gs/src/tool_utils.erl
+@@ -27,6 +27,9 @@
+ -export([file_dialog/1]).
+ -export([notify/2, confirm/2, confirm_yesno/2, request/2]).
+
++%% Browser executable list (openURL command line protocol required)
++-define(BROWSERS, ["netscape", "mozilla", "MozillaFirebird", "opera", "firefox", "seamonkey"]).
++
+ %%----------------------------------------------------------------------
+ %% open_help(GS, File)
+ %% GS = gsobj() (GS root object returned by gs:start/0,1)
+@@ -67,7 +70,7 @@
+ {unix,Type} ->
+ case Type of
+ darwin -> "open " ++ File;
+- _Else -> "netscape -remote \"openURL(file:" ++ File ++ ")\""
++ _Else -> unix_url_command("file:" ++ File)
+ end;
+ {win32,_AnyType} ->
+ "start " ++ filename:nativename(File);
+@@ -82,7 +85,7 @@
+ {unix,Type} ->
+ case Type of
+ darwin -> "open " ++ File;
+- _Else -> "netscape -remote \"openURL(file:" ++ File ++ ")\""
++ _Else -> unix_url_command("file:" ++ File)
+ end;
+ {win32,_AnyType} ->
+ "netscape.exe -h " ++ regexp:gsub(File,"\\\\","/");
+@@ -342,3 +345,53 @@
+ [Last];
+ insert_newlines(Other) ->
+ Other.
++
++%% find_browser(BrowserList) => string() | false
++%% BrowserList - [string()]
++%% Given a list of basenames, find the first available executable.
++
++find_browser([]) ->
++ false;
++
++find_browser([H | T]) ->
++ case os:find_executable(H) of
++ false ->
++ find_browser(T);
++ Browser ->
++ Browser
++ end.
++
++%% unix_url_command(URL) => string()
++%% URL - string()
++%% Open an URL, using a browser which supports the openURL command
++%% line protocol. If no browser is found, the empty string will be
++%% returned.
++
++unix_url_command(URL) ->
++ Template = "BROWSER -remote \"openURL(" ++ URL ++ ")\" || BROWSER " ++ URL ++ "&",
++
++ case os:getenv("BROWSER") of
++ false ->
++ %% look for a compatible browser
++ case find_browser(?BROWSERS) of
++ false ->
++ "";
++ Browser ->
++ case regexp:gsub(Template, "BROWSER", Browser) of
++ {ok, Command, 0} ->
++ %% Template does not contain "BROWSER" placeholder
++ "";
++ {ok, Command, _} ->
++ Command
++ end
++ end;
++
++ Value ->
++ case regexp:gsub(Template, "BROWSER", Value) of
++ {ok, Command2, 0} ->
++ %% no placeholder
++ "";
++ {ok, Command2, _} ->
++ Command2
++ end
++ end.
diff --git a/lang/erlang-runtime15/files/patch-lib_kernel_test_file__SUITE.erl b/lang/erlang-runtime15/files/patch-lib_kernel_test_file__SUITE.erl
new file mode 100644
index 000000000000..1037f72737eb
--- /dev/null
+++ b/lang/erlang-runtime15/files/patch-lib_kernel_test_file__SUITE.erl
@@ -0,0 +1,83 @@
+
+$FreeBSD$
+
+--- lib/kernel/test/file_SUITE.erl.orig
++++ lib/kernel/test/file_SUITE.erl
+@@ -60,7 +60,8 @@
+ -export([ read_not_really_compressed/1,
+ read_compressed_cooked/1, read_compressed_cooked_binary/1,
+ read_cooked_tar_problem/1,
+- write_compressed/1, compress_errors/1, catenated_gzips/1]).
++ write_compressed/1, compress_errors/1, catenated_gzips/1,
++ compress_async_crash/1]).
+
+ -export([ make_link/1, read_link_info_for_non_link/1, symlinks/1]).
+
+@@ -133,7 +134,8 @@
+ {compression, [],
+ [read_compressed_cooked, read_compressed_cooked_binary,
+ read_cooked_tar_problem, read_not_really_compressed,
+- write_compressed, compress_errors, catenated_gzips]},
++ write_compressed, compress_errors, catenated_gzips,
++ compress_async_crash]},
+ {links, [],
+ [make_link, read_link_info_for_non_link, symlinks]}].
+
+@@ -2271,6 +2273,57 @@
+
+ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
++compress_async_crash(suite) -> [];
++compress_async_crash(doc) -> [];
++compress_async_crash(Config) when is_list(Config) ->
++ ?line DataDir = ?config(data_dir, Config),
++ ?line Path = filename:join(DataDir, "test.gz"),
++ ExpectedData = <<"qwerty">>,
++
++ ?line _ = ?FILE_MODULE:delete(Path),
++ ?line {ok, Fd} = ?FILE_MODULE:open(Path, [write, binary, compressed]),
++ ?line ok = ?FILE_MODULE:write(Fd, ExpectedData),
++ ?line ok = ?FILE_MODULE:close(Fd),
++
++ % Test that when using async thread pool, the emulator doesn't crash
++ % when the efile port driver is stopped while a compressed file operation
++ % is in progress (being carried by an async thread).
++ ?line ok = compress_async_crash_loop(10000, Path, ExpectedData),
++ ?line ok = ?FILE_MODULE:delete(Path),
++ ok.
++
++compress_async_crash_loop(0, _Path, _ExpectedData) ->
++ ok;
++compress_async_crash_loop(N, Path, ExpectedData) ->
++ Parent = self(),
++ {Pid, Ref} = spawn_monitor(
++ fun() ->
++ ?line {ok, Fd} = ?FILE_MODULE:open(
++ Path, [read, compressed, raw, binary]),
++ Len = byte_size(ExpectedData),
++ Parent ! {self(), continue},
++ ?line {ok, ExpectedData} = ?FILE_MODULE:read(Fd, Len),
++ ?line ok = ?FILE_MODULE:close(Fd),
++ receive foobar -> ok end
++ end),
++ receive
++ {Pid, continue} ->
++ exit(Pid, shutdown),
++ receive
++ {'DOWN', Ref, _, _, Reason} ->
++ ?line shutdown = Reason
++ end;
++ {'DOWN', Ref, _, _, Reason2} ->
++ test_server:fail({worker_exited, Reason2})
++ after 60000 ->
++ exit(Pid, shutdown),
++ erlang:demonitor(Ref, [flush]),
++ test_server:fail(worker_timeout)
++ end,
++ compress_async_crash_loop(N - 1, Path, ExpectedData).
++
++%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
++
+ altname(doc) ->
+ "Test the file:altname/1 function";
+ altname(suite) ->
diff --git a/lang/erlang-runtime15/files/patch-lib_odbc_c__src_odbcserver.c b/lang/erlang-runtime15/files/patch-lib_odbc_c__src_odbcserver.c
new file mode 100644
index 000000000000..ebe18ff695f6
--- /dev/null
+++ b/lang/erlang-runtime15/files/patch-lib_odbc_c__src_odbcserver.c
@@ -0,0 +1,14 @@
+
+$FreeBSD$
+
+--- lib/odbc/c_src/odbcserver.c.orig
++++ lib/odbc/c_src/odbcserver.c
+@@ -1150,7 +1150,7 @@
+ (column.type.strlen_or_indptr_array[j]));
+ break;
+ case SQL_C_SLONG:
+- ei_x_encode_long(&dynamic_buffer(state), ((long*)values)[j]);
++ ei_x_encode_long(&dynamic_buffer(state), ((SQLINTEGER*)values)[j]);
+ break;
+ case SQL_C_DOUBLE:
+ ei_x_encode_double(&dynamic_buffer(state),
diff --git a/lang/erlang-runtime15/files/patch-lib_runtime__tools_src_observer__backend.erl b/lang/erlang-runtime15/files/patch-lib_runtime__tools_src_observer__backend.erl
new file mode 100644
index 000000000000..9980577fa6c6
--- /dev/null
+++ b/lang/erlang-runtime15/files/patch-lib_runtime__tools_src_observer__backend.erl
@@ -0,0 +1,14 @@
+
+$FreeBSD$
+
+--- lib/runtime_tools/src/observer_backend.erl.orig
++++ lib/runtime_tools/src/observer_backend.erl
+@@ -83,7 +83,7 @@
+ ets -> ets:info(Table, size);
+ mnesia -> mnesia:table_info(Table, size)
+ end,
+- case Size > 0 of
++ case Size =/= undefined andalso Size > 0 of
+ false ->
+ Parent ! {self(), '$end_of_table'},
+ normal;
diff --git a/lang/erlang-runtime15/files/patch-lib_ssl_src_ssl__manager.erl b/lang/erlang-runtime15/files/patch-lib_ssl_src_ssl__manager.erl
new file mode 100644
index 000000000000..4d7a6ca8871b
--- /dev/null
+++ b/lang/erlang-runtime15/files/patch-lib_ssl_src_ssl__manager.erl
@@ -0,0 +1,14 @@
+
+$FreeBSD$
+
+--- lib/ssl/src/ssl_manager.erl.orig
++++ lib/ssl/src/ssl_manager.erl
+@@ -145,7 +145,7 @@
+ call({new_session_id, Port}).
+
+ clean_cert_db(Ref, File) ->
+- erlang:send_after(?CLEAN_CERT_DB, self(), {clean_cert_db, Ref, File}).
++ erlang:send_after(?CLEAN_CERT_DB, get(ssl_manager), {clean_cert_db, Ref, File}).
+
+ %%--------------------------------------------------------------------
+ -spec register_session(inet:port_number(), #session{}) -> ok.
diff --git a/lang/erlang-runtime15/files/patch-lib_stdlib_src_calendar.erl b/lang/erlang-runtime15/files/patch-lib_stdlib_src_calendar.erl
new file mode 100644
index 000000000000..1ab956512316
--- /dev/null
+++ b/lang/erlang-runtime15/files/patch-lib_stdlib_src_calendar.erl
@@ -0,0 +1,29 @@
+
+$FreeBSD$
+
+--- lib/stdlib/src/calendar.erl.orig
++++ lib/stdlib/src/calendar.erl
+@@ -215,11 +215,19 @@
+
+ -spec local_time_to_universal_time_dst(t_datetime1970()) -> [t_datetime1970()].
+ local_time_to_universal_time_dst(DateTime) ->
+- UtDst = erlang:localtime_to_universaltime(DateTime, true),
+- Ut = erlang:localtime_to_universaltime(DateTime, false),
+ %% Reverse check the universal times
+- LtDst = erlang:universaltime_to_localtime(UtDst),
+- Lt = erlang:universaltime_to_localtime(Ut),
++ {UtDst, LtDst} =
++ try
++ UtDst0 = erlang:localtime_to_universaltime(DateTime, true),
++ {UtDst0, erlang:universaltime_to_localtime(UtDst0)}
++ catch error:badarg -> {error, error}
++ end,
++ {Ut, Lt} =
++ try
++ Ut0 = erlang:localtime_to_universaltime(DateTime, false),
++ {Ut0, erlang:universaltime_to_localtime(Ut0)}
++ catch error:badarg -> {error, error}
++ end,
+ %% Return the valid universal times
+ case {LtDst,Lt} of
+ {DateTime,DateTime} when UtDst =/= Ut ->
diff --git a/lang/erlang-runtime15/files/pkg-message.in b/lang/erlang-runtime15/files/pkg-message.in
new file mode 100644
index 000000000000..6e6e14330384
--- /dev/null
+++ b/lang/erlang-runtime15/files/pkg-message.in
@@ -0,0 +1,15 @@
+===========================================================================
+Installation tips:
+
+You can find an emacs mode for Erlang here:
+
+ %%LOCALBASE%%/lib/erlang/lib/tools-%%TOOLS_VSN%%/emacs
+
+You may wish to add the following line to /etc/manpath.config:
+
+OPTIONAL_MANPATH %%LOCALBASE%%/lib/erlang/man
+
+To use this runtime port for development or testing, just prepend
+its binary path ("/usr/local/lib/erlang15/bin") to your PATH variable.
+
+===========================================================================
diff --git a/lang/erlang-runtime15/pkg-descr b/lang/erlang-runtime15/pkg-descr
new file mode 100644
index 000000000000..7bd5f8499016
--- /dev/null
+++ b/lang/erlang-runtime15/pkg-descr
@@ -0,0 +1,10 @@
+Erlang is a programming language used to build massively scalable soft
+real-time systems with requirements on high availability. Some of its
+uses are in telecoms, banking, e-commerce, computer telephony and
+instant messaging. Erlang's runtime system has built-in support for
+concurrency, distribution and fault tolerance.
+
+This port contains a standalone runtime environment of Erlang R15
+to be used during the development of OTP applications.
+
+WWW: http://www.erlang.org/
diff --git a/lang/erlang-runtime15/pkg-plist b/lang/erlang-runtime15/pkg-plist
new file mode 100644
index 000000000000..67ac61425ad2
--- /dev/null
+++ b/lang/erlang-runtime15/pkg-plist
@@ -0,0 +1,17 @@
+@comment Insert PLIST here
+@comment -=[ begin PLIST.lib-erlang ]=-
+@comment -=[ end PLIST.lib-erlang ]=-
+@dirrm lib/%%ERLANG_LIB%%/man/man6
+@dirrm lib/%%ERLANG_LIB%%/man/man4
+@dirrm lib/%%ERLANG_LIB%%/man/man3
+@dirrm lib/%%ERLANG_LIB%%/man/man1
+@dirrm lib/%%ERLANG_LIB%%/man
+@dirrmtry lib/%%ERLANG_LIB%%/lib
+@dirrmtry lib/%%ERLANG_LIB%%
+%%PORTDOCS%%%%DOCSDIR%%/armstrong_thesis_2003.pdf
+%%PORTDOCS%%%%DOCSDIR%%/bjarnelic.pdf
+%%PORTDOCS%%%%DOCSDIR%%/erlang-book-part1.pdf
+%%PORTDOCS%%%%DOCSDIR%%/master_thesis_patterns.pdf
+%%PORTDOCS%%%%DOCSDIR%%/mnesia_overview.pdf
+%%PORTDOCS%%%%DOCSDIR%%/programming_rules.pdf
+%%PORTDOCS%%@dirrm %%DOCSDIR%%