aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--INSTALL.md38
-rw-r--r--erts/aclocal.m411
-rw-r--r--erts/configure.in92
-rw-r--r--erts/emulator/Makefile.in7
-rw-r--r--erts/emulator/beam/beam_bp.c12
-rw-r--r--erts/emulator/beam/beam_bp.h17
-rw-r--r--erts/emulator/beam/beam_emu.c13
-rw-r--r--erts/emulator/beam/erl_nif.c2
-rw-r--r--erts/emulator/beam/utils.c1
-rw-r--r--erts/emulator/drivers/common/inet_drv.c46
-rw-r--r--erts/start_scripts/Makefile10
-rw-r--r--lib/dialyzer/test/behaviour_SUITE_data/results/gen_event_incorrect_return2
-rw-r--r--lib/erl_interface/configure.in6
-rw-r--r--lib/megaco/configure.in2
-rw-r--r--lib/sasl/examples/src/target_system.erl8
-rw-r--r--lib/sasl/src/release_handler.erl2
-rw-r--r--lib/sasl/src/systools_make.erl18
-rw-r--r--lib/sasl/test/release_handler_SUITE.erl5
-rw-r--r--lib/stdlib/doc/src/gen_event.xml17
-rw-r--r--lib/stdlib/src/gen_event.erl3
-rwxr-xr-xlib/wx/configure.in13
21 files changed, 233 insertions, 92 deletions
diff --git a/INSTALL.md b/INSTALL.md
index 8a3b71e4ec..50d1aec2c4 100644
--- a/INSTALL.md
+++ b/INSTALL.md
@@ -674,6 +674,44 @@ test on).
Universal binaries and 64bit binaries are mutually exclusive options.
+Building a fast Erlang VM on Mac OS Lion
+----------------------------------------
+
+Starting with XCode 4.2, Apple no longer includes a "real" `gcc`
+compiler (not based on the LLVM). Building with `llvm-gcc` or `clang`
+will work, but the performance of the Erlang run-time system will not
+be the best possible.
+
+Note that if you have `gcc-4.2` installed and included in `PATH`
+(from a previous version of XCode), `configure` will automatically
+make sure that `gcc-4.2` will be used to compile `beam_emu.c`
+(the source file most in need of `gcc`).
+
+If you don't have `gcc-4.2.` and want to build a run-time system with
+the best possible performance, do like this:
+
+Install XCode from the AppStore if it is not already installed.
+
+Install MacPorts (<http://www.macports.org/>). Then:
+
+ $ sudo port selfupdate
+ $ sudo port install gcc45 +universal
+
+If you want to build the `wx` application, get wxMac-2.8.12
+(`wxMac-2.8.12.tar.gz` from
+<http://sourceforge.net/projects/wxwindows/files/2.8.12/>) and build:
+
+ $ arch_flags="-arch i386" ./configure CFLAGS="$arch_flags" CXXFLAGS="$arch_flags" CPPFLAGS="$arch_flags" LDFLAGS="$arch_flags" OBJCFLAGS="$arch_flags" OBJCXXFLAGS="$arch_flags" --prefix=/usr/local --with-macosx-sdk=/Developer/SDKs/MacOSX10.6.sdk --with-macosx-version-min=10.6 --enable-unicode --with-opengl --disable-shared
+ $ make
+ $ sudo make install
+
+Build Erlang with the MacPorts GCC as the main compiler (using `clang`
+for the Objective-C Cocoa code in the `wx` application):
+
+ $ PATH=/usr/local/bin:$PATH CC=/opt/local/bin/gcc-mp-4.5 CXX=/opt/local/bin/g++-mp-4.5 ./configure --enable-m32-build make
+ $ sudo make install
+
+
How to Build a Debug Enabled Erlang RunTime System
--------------------------------------------------
diff --git a/erts/aclocal.m4 b/erts/aclocal.m4
index bd228a2d1f..ea5cc67fbe 100644
--- a/erts/aclocal.m4
+++ b/erts/aclocal.m4
@@ -125,8 +125,10 @@ AC_DEFUN(LM_FIND_EMU_CC,
ac_cv_prog_emu_cc,
[
AC_TRY_COMPILE([],[
-#ifdef __llvm__
-#error "llvm is currently unable to compile beam_emu.c"
+#if defined(__clang_major__) && __clang_major__ >= 3
+ /* clang 3.x or later is fine */
+#elif defined(__llvm__)
+#error "this version of llvm is unable to correctly compile beam_emu.c"
#endif
__label__ lbl1;
__label__ lbl2;
@@ -168,6 +170,11 @@ if test $ac_cv_prog_emu_cc != no; then
CFLAGS=""
CPPFLAGS=""
AC_TRY_COMPILE([],[
+#if defined(__clang_major__) && __clang_major__ >= 3
+ /* clang 3.x or later is fine */
+#elif defined(__llvm__)
+#error "this version of llvm is unable to correctly compile beam_emu.c"
+#endif
__label__ lbl1;
__label__ lbl2;
int x = magic();
diff --git a/erts/configure.in b/erts/configure.in
index e3eb6034e6..378d0ab220 100644
--- a/erts/configure.in
+++ b/erts/configure.in
@@ -490,19 +490,6 @@ CFLAG_RUNTIME_LIBRARY_PATH="-Wl,-R"
case $host_os in
darwin*)
CFLAG_RUNTIME_LIBRARY_PATH=
- AC_TRY_COMPILE([],[
- #if __GNUC__ >= 4
- ;
- #else
- #error old or no gcc
- #endif
- ],
- gcc_need_no_cpp_precomp=no,
- gcc_need_no_cpp_precomp=yes)
-
- if test x$gcc_need_no_cpp_precomp = xyes; then
- CFLAGS="$CFLAGS -no-cpp-precomp"
- fi
;;
win32)
CFLAG_RUNTIME_LIBRARY_PATH=
@@ -1479,9 +1466,71 @@ AC_CHECK_HEADERS(fcntl.h limits.h unistd.h syslog.h dlfcn.h ieeefp.h \
sys/types.h sys/stropts.h sys/sysctl.h \
sys/ioctl.h sys/time.h sys/uio.h \
sys/socket.h sys/sockio.h sys/socketio.h \
- net/errno.h malloc.h arpa/nameser.h \
+ net/errno.h malloc.h arpa/nameser.h libdlpi.h \
pty.h util.h utmp.h langinfo.h poll.h sdkddkver.h)
+AC_CHECK_MEMBERS([struct ifreq.ifr_hwaddr], [], [],
+ [#ifdef __WIN32__
+ #else
+ #ifdef VXWORKS
+ #else
+ #include <net/if.h>
+ #endif
+ #endif
+ ])
+
+AC_CHECK_MEMBERS([struct ifreq.ifr_enaddr], [], [],
+ [#ifdef __WIN32__
+ #else
+ #ifdef VXWORKS
+ #else
+ #include <net/if.h>
+ #endif
+ #endif
+ ])
+
+dnl ----------------------------------------------------------------------
+dnl Check the availability for libdlpi
+dnl ----------------------------------------------------------------------
+AC_CHECK_LIB(dlpi, dlpi_open)
+if test x"$ac_cv_lib_dlpi_dlpi_open" = x"no"; then
+ unset -v ac_cv_lib_dlpi_dlpi_open
+ dnl Try again now with -L/lib (or ditto 64) as argument to linker since
+ dnl gcc makes /usr/ccs/bin/ld ignore the crle configured linker default paths
+ dnl typically causing dlpi not being found on Solaris et.al
+ save_ldflags="$LDFLAGS"
+ try_dlpi_lib=/lib
+ if test x"$ac_cv_sizeof_void_p" = x"8"; then
+ if test -d /lib64; then
+ try_dlpi_lib=/lib64
+ elif test -d /lib/64; then
+ try_dlpi_lib=/lib/64
+ fi
+ fi
+ if test ! -f "$try_dlpi_lib/libdlpi.so" && \
+ test -f "$try_dlpi_lib/libdlpi.so.1"
+ then
+ dnl It looks like there is a missing symlink
+ dnl - let's be helpful and notify the user
+ dnl NOTE this help is far from perfect e.g if there would be no
+ dnl *.so.1 but a *.so.1.123 or *.so.2 this will be no help
+ AC_MSG_ERROR(
+ [Your OS installation is missing a symbolic link.
+ Maybe it lacks some development package(s)...
+ It can anyhow be fixed with the following command:
+ # ln -s libdlpi.so.1 $try_dlpi_lib/libdlpi.so
+ ])
+ fi
+ LDFLAGS="-L$try_dlpi_lib -R$try_dlpi_lib $LDFLAGS"
+ unset -v try_dlpi_lib
+ AC_MSG_NOTICE([Extending the search to include /lib])
+ AC_CHECK_LIB(dlpi, dlpi_open)
+ if test x"$ac_cv_lib_dlpi_dlpi_open" = x"no"; then
+ LDFLAGS="$save_ldflags"
+ fi
+ unset -v save_ldflags
+fi
+
AC_CHECK_HEADER(sys/resource.h,
[AC_DEFINE(HAVE_SYS_RESOURCE_H, 1,
[Define to 1 if you have the <sys/resource.h> header file])
@@ -1508,6 +1557,9 @@ if test "x$enable_sctp" != "xno" ; then
#include <sys/socket.h>
#endif
])
+fi
+
+if test x"$ac_cv_header_netinet_sctp_h" = x"yes"; then
AC_CHECK_FUNCS([sctp_bindx sctp_peeloff])
AC_CHECK_DECLS([SCTP_UNORDERED, SCTP_ADDR_OVER, SCTP_ABORT,
SCTP_EOF, SCTP_SENDALL, SCTP_ADDR_CONFIRMED,
@@ -2458,6 +2510,17 @@ case $ARCH-$OPSYS in
darwin_mcontext_leopard=no
;;
esac
+
+if test X${enable_fp_exceptions} = Xauto ; then
+ case $host_os in
+ darwin*)
+ enable_fp_exceptions=no
+ AC_MSG_NOTICE([Floating point exceptions disabled by default on MacOS X]) ;;
+ *)
+ ;;
+ esac
+fi
+
if test X${enable_fp_exceptions} = Xauto ; then
if test X${enable_hipe} = Xyes; then
enable_fp_exceptions=yes
@@ -4303,7 +4366,6 @@ AH_BOTTOM([
#endif
])
-
dnl ----------------------------------------------------------------------
dnl Output the result.
dnl ----------------------------------------------------------------------
diff --git a/erts/emulator/Makefile.in b/erts/emulator/Makefile.in
index a2cef8a8a5..289d5e2a9d 100644
--- a/erts/emulator/Makefile.in
+++ b/erts/emulator/Makefile.in
@@ -359,7 +359,6 @@ ERLANG_OSTYPE = @ERLANG_OSTYPE@
ENABLE_ALLOC_TYPE_VARS += @ERLANG_OSTYPE@
-EMULATOR_EXECUTABLE_ELIB = beam.elib$(TF_MARKER)
ifeq ($(TARGET), win32)
EMULATOR_EXECUTABLE = beam$(TF_MARKER).dll
else
@@ -942,7 +941,6 @@ $(TARGET)/Makefile: Makefile.in
#SED_REPL_WIN_DRIVE=s|\([ ]\)\([A-Za-z]\):|\1/cygdrive/\2|g;s|^\([A-Za-z]\):|/cygdrive/\1|g
SED_REPL_O=s|^\([^:]*:\)|$$(OBJDIR)/\1|g
-SED_REPL_ELIB_O=s|^\([^:]*\).o[ ]*:|$$(OBJDIR)/\1.elib.o:|g
SED_REPL_TTF_DIR=s|$(TTF_DIR)/|$$(TTF_DIR)/|g
SED_REPL_ERL_TOP=s|\([ ]\)$(ERL_TOP)/|\1$$(ERL_TOP)/|g;s|^$(ERL_TOP)/|$$(ERL_TOP)/|g
SED_REPL_POLL=s|$$(OBJDIR)/erl_poll.o|$$(OBJDIR)/erl_poll.kp.o $$(OBJDIR)/erl_poll.nkp.o|g
@@ -962,7 +960,6 @@ SED_SUFFIX=
endif
SED_DEPEND=sed '$(SED_PREFIX)$(SED_REPL_O);$(SED_REPL_TTF_DIR);$(SED_REPL_ERL_TOP)$(SED_SUFFIX)'
-SED_ELIB_DEPEND=sed '$(SED_PREFIX)$(SED_REPL_ELIB_O);$(SED_REPL_TTF_DIR);$(SED_REPL_ERL_TOP)$(SED_SUFFIX)'
ifdef HIPE_ENABLED
HIPE_SRC=$(wildcard hipe/*.c)
@@ -1018,10 +1015,6 @@ depend:
| $(SED_DEPEND) >> $(TARGET)/depend.mk
$(DEP_CC) $(DEP_FLAGS) $(TARGET_SRC) \
| $(SED_DEPEND) >> $(TARGET)/depend.mk
-ifneq ($(TARGET),win32)
- $(DEP_CC) $(DEP_FLAGS) $(ELIB_C_FILES) \
- | $(SED_ELIB_DEPEND) >> $(TARGET)/depend.mk
-endif
ifdef HIPE_ENABLED
$(DEP_CC) $(DEP_FLAGS) $(HIPE_SRC) \
| $(SED_DEPEND) >> $(TARGET)/depend.mk
diff --git a/erts/emulator/beam/beam_bp.c b/erts/emulator/beam/beam_bp.c
index dd31376a2d..692fa61fe8 100644
--- a/erts/emulator/beam/beam_bp.c
+++ b/erts/emulator/beam/beam_bp.c
@@ -495,16 +495,6 @@ erts_find_local_func(Eterm mfa[3]) {
return NULL;
}
-/* bp_hash */
-ERTS_INLINE Uint bp_sched2ix() {
-#ifdef ERTS_SMP
- ErtsSchedulerData *esdp;
- esdp = erts_get_scheduler_data();
- return esdp->no - 1;
-#else
- return 0;
-#endif
-}
static void bp_hash_init(bp_time_hash_t *hash, Uint n) {
Uint size = sizeof(bp_data_time_item_t)*n;
Uint i;
@@ -1347,7 +1337,7 @@ static BpData *is_break(BeamInstr *pc, BeamInstr break_op) {
return NULL;
}
- bd = ebd = rs[bp_sched2ix()];
+ bd = ebd = rs[erts_bp_sched2ix()];
ASSERT(bd);
if ( (break_op == 0) || (bd->this_instr == break_op)) {
return bd;
diff --git a/erts/emulator/beam/beam_bp.h b/erts/emulator/beam/beam_bp.h
index 2ec5818688..167069552f 100644
--- a/erts/emulator/beam/beam_bp.h
+++ b/erts/emulator/beam/beam_bp.h
@@ -144,8 +144,6 @@ extern erts_smp_spinlock_t erts_bp_lock;
#define ErtsSmpBPUnlock(BDC)
#endif
-ERTS_INLINE Uint bp_sched2ix(void);
-
#ifdef ERTS_SMP
#define bp_sched2ix_proc(p) ((p)->scheduler_data->no - 1)
#else
@@ -247,4 +245,19 @@ BpData *erts_get_time_break(Process *p, BeamInstr *pc);
BeamInstr *erts_find_local_func(Eterm mfa[3]);
+ERTS_GLB_INLINE Uint erts_bp_sched2ix(void);
+
+#if ERTS_GLB_INLINE_INCL_FUNC_DEF
+ERTS_GLB_INLINE Uint erts_bp_sched2ix(void)
+{
+#ifdef ERTS_SMP
+ ErtsSchedulerData *esdp;
+ esdp = erts_get_scheduler_data();
+ return esdp->no - 1;
+#else
+ return 0;
+#endif
+}
+#endif
+
#endif /* _BEAM_BP_H */
diff --git a/erts/emulator/beam/beam_emu.c b/erts/emulator/beam/beam_emu.c
index 234355de42..c65b2be106 100644
--- a/erts/emulator/beam/beam_emu.c
+++ b/erts/emulator/beam/beam_emu.c
@@ -45,7 +45,7 @@
/* #define HARDDEBUG 1 */
#if defined(NO_JUMP_TABLE)
-# define OpCase(OpCode) case op_##OpCode: lb_##OpCode
+# define OpCase(OpCode) case op_##OpCode
# define CountCase(OpCode) case op_count_##OpCode
# define OpCode(OpCode) ((Uint*)op_##OpCode)
# define Goto(Rel) {Go = (int)(Rel); goto emulator_loop;}
@@ -53,7 +53,7 @@
#else
# define OpCase(OpCode) lb_##OpCode
# define CountCase(OpCode) lb_count_##OpCode
-# define Goto(Rel) goto *(Rel)
+# define Goto(Rel) goto *((void *)Rel)
# define LabelAddr(Label) &&Label
# define OpCode(OpCode) (&&lb_##OpCode)
#endif
@@ -199,7 +199,7 @@ do { \
} \
} while (0)
-#define ClauseFail() goto lb_jump_f
+#define ClauseFail() goto jump_f
#define SAVE_CP(X) \
do { \
@@ -2547,6 +2547,7 @@ void process_main(void)
lb_Cl_error: {
if (Arg(0) != 0) {
OpCase(jump_f): {
+ jump_f:
SET_I((BeamInstr *) Arg(0));
Goto(*I);
}
@@ -3120,7 +3121,7 @@ void process_main(void)
/* Fall through */
OpCase(error_action_code): {
- no_error_handler:
+ handle_error:
reg[0] = r(0);
SWAPOUT;
I = handle_error(c_p, NULL, reg, NULL);
@@ -3281,7 +3282,7 @@ void process_main(void)
OpCase(i_func_info_IaaI): {
c_p->freason = EXC_FUNCTION_CLAUSE;
c_p->current = I + 2;
- goto lb_error_action_code;
+ goto handle_error;
}
OpCase(try_case_end_s):
@@ -4967,7 +4968,7 @@ void process_main(void)
if (I) {
Goto(*I);
}
- goto no_error_handler;
+ goto handle_error;
}
diff --git a/erts/emulator/beam/erl_nif.c b/erts/emulator/beam/erl_nif.c
index 62798bb2c1..740a1b853e 100644
--- a/erts/emulator/beam/erl_nif.c
+++ b/erts/emulator/beam/erl_nif.c
@@ -1669,7 +1669,7 @@ BIF_RETTYPE load_nif_2(BIF_ALIST_2)
}
else { /* Function traced, patch the original instruction word */
BpData** bps = (BpData**) code_ptr[1];
- BpData* bp = (BpData*) bps[bp_sched2ix()];
+ BpData* bp = (BpData*) bps[erts_bp_sched2ix()];
bp->orig_instr = (BeamInstr) BeamOp(op_call_nif);
}
code_ptr[5+1] = (BeamInstr) entry->funcs[i].fptr;
diff --git a/erts/emulator/beam/utils.c b/erts/emulator/beam/utils.c
index 8d4073f40f..df03f5e42c 100644
--- a/erts/emulator/beam/utils.c
+++ b/erts/emulator/beam/utils.c
@@ -45,6 +45,7 @@
#include "erl_thr_progress.h"
#include "erl_thr_queue.h"
#include "erl_sched_spec_pre_alloc.h"
+#include "beam_bp.h"
#undef M_TRIM_THRESHOLD
#undef M_TOP_PAD
diff --git a/erts/emulator/drivers/common/inet_drv.c b/erts/emulator/drivers/common/inet_drv.c
index dcc2954b02..db052523a8 100644
--- a/erts/emulator/drivers/common/inet_drv.c
+++ b/erts/emulator/drivers/common/inet_drv.c
@@ -4222,6 +4222,31 @@ static int inet_ctl_getiflist(inet_descriptor* desc, char** rbuf, int rsize)
return sp - sbuf;
}
+#ifdef HAVE_LIBDLPI_H
+#include <libdlpi.h>
+static int hwaddr_libdlpi_lookup(const char *ifnm,
+ uchar_t *addr, size_t *alen)
+{
+ dlpi_handle_t handle;
+ dlpi_info_t linkinfo;
+ int ret = -1;
+
+ if (dlpi_open(ifnm, &handle, 0) != DLPI_SUCCESS) {
+ return -1;
+ }
+
+ if (dlpi_get_physaddr(handle, DL_CURR_PHYS_ADDR,
+ addr, alen) == DLPI_SUCCESS &&
+ dlpi_info(handle, &linkinfo, 0) == DLPI_SUCCESS)
+ {
+ ret = 0;
+ }
+
+ dlpi_close(handle);
+ return ret;
+}
+#endif
+
/* FIXME: temporary hack */
#ifndef IFHWADDRLEN
#define IFHWADDRLEN 6
@@ -4257,7 +4282,24 @@ static int inet_ctl_ifget(inet_descriptor* desc, char* buf, int len,
break;
case INET_IFOPT_HWADDR: {
-#ifdef SIOCGIFHWADDR
+#ifdef HAVE_LIBDLPI_H
+ /*
+ ** OpenSolaris have SIGCGIFHWADDR, but no ifr_hwaddr member..
+ ** The proper way to get the mac address would be to
+ ** use libdlpi...
+ */
+ uchar_t addr[DLPI_PHYSADDR_MAX];
+ size_t alen = sizeof(addr);
+
+ if (hwaddr_libdlpi_lookup(ifreq.ifr_name, addr, &alen) == 0) {
+ buf_check(sptr, s_end, 1+2+alen);
+ *sptr++ = INET_IFOPT_HWADDR;
+ put_int16(alen, sptr);
+ sptr += 2;
+ sys_memcpy(sptr, addr, alen);
+ sptr += alen;
+ }
+#elif defined(SIOCGIFHWADDR) && defined(HAVE_STRUCT_IFREQ_IFR_HWADDR)
if (ioctl(desc->s, SIOCGIFHWADDR, (char *)&ifreq) < 0)
break;
buf_check(sptr, s_end, 1+2+IFHWADDRLEN);
@@ -4266,7 +4308,7 @@ static int inet_ctl_ifget(inet_descriptor* desc, char* buf, int len,
/* raw memcpy (fix include autoconf later) */
sys_memcpy(sptr, (char*)(&ifreq.ifr_hwaddr.sa_data), IFHWADDRLEN);
sptr += IFHWADDRLEN;
-#elif defined(SIOCGENADDR)
+#elif defined(SIOCGENADDR) && defined(HAVE_STRUCT_IFREQ_IFR_ENADDR)
if (ioctl(desc->s, SIOCGENADDR, (char *)&ifreq) < 0)
break;
buf_check(sptr, s_end, 1+2+sizeof(ifreq.ifr_enaddr));
diff --git a/erts/start_scripts/Makefile b/erts/start_scripts/Makefile
index c2576ee4cc..d8e39062e3 100644
--- a/erts/start_scripts/Makefile
+++ b/erts/start_scripts/Makefile
@@ -145,13 +145,11 @@ bootstrap_scripts: $(SS_ROOT)/start_clean.rel
$(INSTALL_DIR) $(TESTROOT)/bin
$(INSTALL_DIR) $(SS_TMP)
( cd $(SS_TMP) && \
- $(ERLC) $(BOOTSTRAP_SCRIPT_PATH) +no_warn_sasl +otp_build \
- +no_module_tests -o $(TESTROOT)/bin/start.script \
- $(SS_ROOT)/start_clean.rel )
+ $(ERLC) $(BOOTSTRAP_SCRIPT_PATH) +otp_build +no_module_tests \
+ -o $(TESTROOT)/bin/start.script $(SS_ROOT)/start_clean.rel )
( cd $(SS_TMP) && \
- $(ERLC) $(BOOTSTRAP_SCRIPT_PATH) +no_warn_sasl +otp_build \
- +no_module_tests -o $(TESTROOT)/bin/start_clean.script \
- $(SS_ROOT)/start_clean.rel )
+ $(ERLC) $(BOOTSTRAP_SCRIPT_PATH) +otp_build +no_module_tests \
+ -o $(TESTROOT)/bin/start_clean.script $(SS_ROOT)/start_clean.rel )
clean:
$(RM) $(REL_SCRIPTS) $(INSTALL_SCRIPTS)
diff --git a/lib/dialyzer/test/behaviour_SUITE_data/results/gen_event_incorrect_return b/lib/dialyzer/test/behaviour_SUITE_data/results/gen_event_incorrect_return
index 2afb5db133..e646eea383 100644
--- a/lib/dialyzer/test/behaviour_SUITE_data/results/gen_event_incorrect_return
+++ b/lib/dialyzer/test/behaviour_SUITE_data/results/gen_event_incorrect_return
@@ -1,2 +1,2 @@
-gen_event_incorrect_return.erl:16: The inferred return type of init/1 ('error') has nothing in common with {'ok',_} | {'ok',_,'hibernate'}, which is the expected return type for the callback of gen_event behaviour
+gen_event_incorrect_return.erl:16: The inferred return type of init/1 ('error') has nothing in common with {'error',_} | {'ok',_} | {'ok',_,'hibernate'}, which is the expected return type for the callback of gen_event behaviour
diff --git a/lib/erl_interface/configure.in b/lib/erl_interface/configure.in
index 72ac8c7bbf..abe1602be1 100644
--- a/lib/erl_interface/configure.in
+++ b/lib/erl_interface/configure.in
@@ -338,12 +338,6 @@ AC_SUBST(LIB_CFLAGS)
if test "X$host" = "Xwin32"; then
LIB_CFLAGS="$CFLAGS"
else
- case $host_os in
- darwin*)
- CFLAGS="$CFLAGS -no-cpp-precomp"
- ;;
- esac
-
if test "x$GCC" = xyes; then
LIB_CFLAGS="$CFLAGS -fPIC"
else
diff --git a/lib/megaco/configure.in b/lib/megaco/configure.in
index b88e17ec85..42c50b8961 100644
--- a/lib/megaco/configure.in
+++ b/lib/megaco/configure.in
@@ -208,7 +208,7 @@ if test "X$host" = "Xwin32"; then
else
case $host_os in
darwin*)
- CFLAGS="$CFLAGS -no-cpp-precomp -fno-common"
+ CFLAGS="$CFLAGS -fno-common"
;;
esac
diff --git a/lib/sasl/examples/src/target_system.erl b/lib/sasl/examples/src/target_system.erl
index 0e1e0b2324..ffc0fcf443 100644
--- a/lib/sasl/examples/src/target_system.erl
+++ b/lib/sasl/examples/src/target_system.erl
@@ -16,6 +16,7 @@
%%
%% %CopyrightEnd%
%%
+%module
-module(target_system).
-export([create/1, create/2, install/2]).
@@ -130,14 +131,14 @@ install(RelFileName, RootDir) ->
[ErlVsn, _RelVsn| _] = string:tokens(StartErlData, " \n"),
ErtsBinDir = filename:join([RootDir, "erts-" ++ ErlVsn, "bin"]),
BinDir = filename:join([RootDir, "bin"]),
- io:fwrite("Substituting in erl.src, start.src and start_erl.src to\n"
+ io:fwrite("Substituting in erl.src, start.src and start_erl.src to "
"form erl, start and start_erl ...\n"),
subst_src_scripts(["erl", "start", "start_erl"], ErtsBinDir, BinDir,
[{"FINAL_ROOTDIR", RootDir}, {"EMU", "beam"}],
[preserve]),
io:fwrite("Creating the RELEASES file ...\n"),
- create_RELEASES(RootDir,
- filename:join([RootDir, "releases", RelFileName])).
+ create_RELEASES(RootDir, filename:join([RootDir, "releases",
+ filename:basename(RelFileName)])).
%% LOCALS
@@ -257,3 +258,4 @@ remove_all_files(Dir, Files) ->
file:delete(FilePath)
end
end, Files).
+%module
diff --git a/lib/sasl/src/release_handler.erl b/lib/sasl/src/release_handler.erl
index b6ef8582c4..ce34674e25 100644
--- a/lib/sasl/src/release_handler.erl
+++ b/lib/sasl/src/release_handler.erl
@@ -842,8 +842,6 @@ do_unpack_release(Root, RelDir, ReleaseName, Releases) ->
extract_tar(Root, Tar),
NewReleases = [Release#release{status = unpacked} | Releases],
write_releases(RelDir, NewReleases, false),
- Dir = filename:join([RelDir, Vsn]),
- copy_file(RelFile, Dir, false),
{ok, NewReleases, Vsn}.
%% Note that this function is not executed by a client
diff --git a/lib/sasl/src/systools_make.erl b/lib/sasl/src/systools_make.erl
index 1c14027805..8fd90c50f9 100644
--- a/lib/sasl/src/systools_make.erl
+++ b/lib/sasl/src/systools_make.erl
@@ -1638,8 +1638,19 @@ add_system_files(Tar, RelName, Release, Path1) ->
SVsn = Release#release.vsn,
RelName0 = filename:basename(RelName),
+ RelVsnDir = filename:join("releases", SVsn),
+
+ %% OTP-9746: store rel file in releases/<vsn>
+ %% Adding rel file to
+ %% 1) releases directory - so it can be easily extracted
+ %% separately (see release_handler:unpack_release)
+ %% 2) releases/<vsn> - so the file must not be explicitly moved
+ %% after unpack.
add_to_tar(Tar, RelName ++ ".rel",
filename:join("releases", RelName0 ++ ".rel")),
+ add_to_tar(Tar, RelName ++ ".rel",
+ filename:join(RelVsnDir, RelName0 ++ ".rel")),
+
%% OTP-6226 Look for the system files not only in cwd
%% --
@@ -1655,26 +1666,25 @@ add_system_files(Tar, RelName, Release, Path1) ->
[RelDir, "."|Path1]
end,
- ToDir = filename:join("releases", SVsn),
case lookup_file(RelName0 ++ ".boot", Path) of
false ->
throw({error, {tar_error,{add, RelName0++".boot",enoent}}});
Boot ->
- add_to_tar(Tar, Boot, filename:join(ToDir, "start.boot"))
+ add_to_tar(Tar, Boot, filename:join(RelVsnDir, "start.boot"))
end,
case lookup_file("relup", Path) of
false ->
ignore;
Relup ->
- add_to_tar(Tar, Relup, filename:join(ToDir, "relup"))
+ add_to_tar(Tar, Relup, filename:join(RelVsnDir, "relup"))
end,
case lookup_file("sys.config", Path) of
false ->
ignore;
Sys ->
- add_to_tar(Tar, Sys, filename:join(ToDir, "sys.config"))
+ add_to_tar(Tar, Sys, filename:join(RelVsnDir, "sys.config"))
end,
ok.
diff --git a/lib/sasl/test/release_handler_SUITE.erl b/lib/sasl/test/release_handler_SUITE.erl
index 454fe26323..4e5742a5d4 100644
--- a/lib/sasl/test/release_handler_SUITE.erl
+++ b/lib/sasl/test/release_handler_SUITE.erl
@@ -1395,6 +1395,7 @@ target_system(Conf) when is_list(Conf) ->
KernelVsn = vsn(kernel,current),
StdlibVsn = vsn(stdlib,current),
SaslVsn = vsn(sasl,current),
+ RelFileBasename = filename:basename(RelFile),
true = filelib:is_dir(filename:join(LibDir,"kernel-"++KernelVsn)),
true = filelib:is_dir(filename:join(LibDir,"stdlib-"++StdlibVsn)),
true = filelib:is_dir(filename:join(LibDir,"sasl-"++SaslVsn)),
@@ -1402,10 +1403,10 @@ target_system(Conf) when is_list(Conf) ->
RelDir = filename:join(TargetInstallDir,releases),
true = filelib:is_regular(filename:join(RelDir,"RELEASES")),
true = filelib:is_regular(filename:join(RelDir,"start_erl.data")),
- true = filelib:is_regular(filename:join(RelDir,
- filename:basename(RelFile))),
+ true = filelib:is_regular(filename:join(RelDir,RelFileBasename)),
true = filelib:is_dir(filename:join(RelDir,RelVsn)),
true = filelib:is_regular(filename:join([RelDir,RelVsn,"start.boot"])),
+ true = filelib:is_regular(filename:join([RelDir,RelVsn,RelFileBasename])),
BinDir = filename:join(TargetInstallDir,bin),
true = filelib:is_regular(filename:join(BinDir,"start.boot")),
true = filelib:is_regular(filename:join(BinDir,erl)),
diff --git a/lib/stdlib/doc/src/gen_event.xml b/lib/stdlib/doc/src/gen_event.xml
index 24bcb419fe..79a0c8ad89 100644
--- a/lib/stdlib/doc/src/gen_event.xml
+++ b/lib/stdlib/doc/src/gen_event.xml
@@ -195,12 +195,13 @@ gen_event:stop -----> Module:terminate/2
handlers using the same callback module.</p>
<p><c>Args</c> is an arbitrary term which is passed as the argument
to <c>Module:init/1</c>.</p>
- <p>If <c>Module:init/1</c> returns a correct value, the event
- manager adds the event handler and this function returns
+ <p>If <c>Module:init/1</c> returns a correct value indicating
+ successful completion, the event manager adds the event
+ handler and this function returns
<c>ok</c>. If <c>Module:init/1</c> fails with <c>Reason</c> or
- returns an unexpected value <c>Term</c>, the event handler is
+ returns <c>{error,Reason}</c>, the event handler is
ignored and this function returns <c>{'EXIT',Reason}</c> or
- <c>Term</c>, respectively.</p>
+ <c>{error,Reason}</c>, respectively.</p>
</desc>
</func>
<func>
@@ -448,12 +449,13 @@ gen_event:stop -----> Module:terminate/2
</section>
<funcs>
<func>
- <name>Module:init(InitArgs) -> {ok,State} | {ok,State,hibernate}</name>
+ <name>Module:init(InitArgs) -> {ok,State} | {ok,State,hibernate} | {error,Reason}</name>
<fsummary>Initialize an event handler.</fsummary>
<type>
<v>InitArgs = Args | {Args,Term}</v>
<v>&nbsp;Args = Term = term()</v>
<v>State = term()</v>
+ <v>Reason = term()</v>
</type>
<desc>
<p>Whenever a new event handler is added to an event manager,
@@ -470,8 +472,9 @@ gen_event:stop -----> Module:terminate/2
the argument provided in the function call/return tuple and
<c>Term</c> is the result of terminating the old event handler,
see <c>gen_event:swap_handler/3</c>.</p>
- <p>The function should return <c>{ok,State}</c> or <c>{ok,State, hibernate}</c>
- where <c>State</c> is the initial internal state of the event handler.</p>
+ <p>If successful, the function should return <c>{ok,State}</c>
+ or <c>{ok,State,hibernate}</c> where <c>State</c> is the
+ initial internal state of the event handler.</p>
<p>If <c>{ok,State,hibernate}</c> is returned, the event
manager will go into hibernation (by calling <seealso
marker="proc_lib#hibernate/3">proc_lib:hibernate/3</seealso>),
diff --git a/lib/stdlib/src/gen_event.erl b/lib/stdlib/src/gen_event.erl
index 9879b76391..3317b30e5c 100644
--- a/lib/stdlib/src/gen_event.erl
+++ b/lib/stdlib/src/gen_event.erl
@@ -70,7 +70,8 @@
-callback init(InitArgs :: term()) ->
{ok, State :: term()} |
- {ok, State :: term(), hibernate}.
+ {ok, State :: term(), hibernate} |
+ {error, Reason :: term()}.
-callback handle_event(Event :: term(), State :: term()) ->
{ok, NewState :: term()} |
{ok, NewState :: term(), hibernate} |
diff --git a/lib/wx/configure.in b/lib/wx/configure.in
index 78c3f0d3d2..e5dc83b27e 100755
--- a/lib/wx/configure.in
+++ b/lib/wx/configure.in
@@ -219,19 +219,6 @@ AC_SUBST(OBJC_CFLAGS)
case $host_os in
darwin*)
- AC_TRY_COMPILE([],[
- #if __GNUC__ >= 4
- ;
- #else
- #error old or no gcc
- #endif
- ],
- gcc_need_no_cpp_precomp=no,
- gcc_need_no_cpp_precomp=yes)
-
- if test x$gcc_need_no_cpp_precomp = xyes; then
- CFLAGS="-no-cpp-precomp $CFLAGS"
- fi
LDFLAGS="-bundle -flat_namespace -undefined warning -fPIC $LDFLAGS"
# Check sizof_void_p as future will hold 64bit MacOS wx
if test $ac_cv_sizeof_void_p = 4; then