diff options
author | Micael Karlberg <[email protected]> | 2019-03-19 18:19:49 +0100 |
---|---|---|
committer | Micael Karlberg <[email protected]> | 2019-04-30 10:58:16 +0200 |
commit | b6c6aba478e314f60647bf2868eb4ebc59d3c719 (patch) | |
tree | 042ad1f482213150815293a73393df9ee2c07ec3 /erts | |
parent | 953f39ad8ce262d1104bd7e29338e43153bbd123 (diff) | |
download | otp-b6c6aba478e314f60647bf2868eb4ebc59d3c719.tar.gz otp-b6c6aba478e314f60647bf2868eb4ebc59d3c719.tar.bz2 otp-b6c6aba478e314f60647bf2868eb4ebc59d3c719.zip |
[socket|net] Final prep
The config options --[en|dis]able-esock now works as
expected.
Diffstat (limited to 'erts')
-rw-r--r-- | erts/configure.in | 2 | ||||
-rw-r--r-- | erts/emulator/Makefile.in | 35 | ||||
-rw-r--r-- | erts/preloaded/ebin/erl_init.beam | bin | 1820 -> 1280 bytes | |||
-rw-r--r-- | erts/preloaded/ebin/net.beam | bin | 5940 -> 2460 bytes | |||
-rw-r--r-- | erts/preloaded/src/erl_init.erl | 24 | ||||
-rw-r--r-- | erts/preloaded/src/net.erl | 3 |
6 files changed, 45 insertions, 19 deletions
diff --git a/erts/configure.in b/erts/configure.in index f17572142d..2538505ee7 100644 --- a/erts/configure.in +++ b/erts/configure.in @@ -2,7 +2,7 @@ dnl Process this file with autoconf to produce a configure script. -*-m4-*- dnl %CopyrightBegin% dnl -dnl Copyright Ericsson AB 1997-2018. All Rights Reserved. +dnl Copyright Ericsson AB 1997-2019. All Rights Reserved. dnl dnl Licensed under the Apache License, Version 2.0 (the "License"); dnl you may not use this file except in compliance with the License. diff --git a/erts/emulator/Makefile.in b/erts/emulator/Makefile.in index 1c85c4e827..a9f3bb8e89 100644 --- a/erts/emulator/Makefile.in +++ b/erts/emulator/Makefile.in @@ -633,6 +633,15 @@ GENERATE += $(TTF_DIR)/driver_tab.c # This list must be consistent with PRE_LOADED_MODULES in # erts/preloaded/src/Makefile. +ifeq ($(USE_ESOCK), yes) +ESOCK_PRELOAD_BEAM = \ + $(ERL_TOP)/erts/preloaded/ebin/socket.beam \ + $(ERL_TOP)/erts/preloaded/ebin/net.beam +else +ESOCK_PRELOAD_BEAM = \ + $(ERL_TOP)/erts/preloaded/ebin/net.beam +endif + PRELOAD_BEAM = $(ERL_TOP)/erts/preloaded/ebin/erts_code_purger.beam \ $(ERL_TOP)/erts/preloaded/ebin/erl_init.beam \ $(ERL_TOP)/erts/preloaded/ebin/init.beam \ @@ -641,8 +650,7 @@ PRELOAD_BEAM = $(ERL_TOP)/erts/preloaded/ebin/erts_code_purger.beam \ $(ERL_TOP)/erts/preloaded/ebin/prim_inet.beam \ $(ERL_TOP)/erts/preloaded/ebin/prim_file.beam \ $(ERL_TOP)/erts/preloaded/ebin/zlib.beam \ - $(ERL_TOP)/erts/preloaded/ebin/socket.beam \ - $(ERL_TOP)/erts/preloaded/ebin/net.beam \ + $(ESOCK_PRELOAD_BEAM) \ $(ERL_TOP)/erts/preloaded/ebin/prim_zip.beam \ $(ERL_TOP)/erts/preloaded/ebin/erl_prim_loader.beam \ $(ERL_TOP)/erts/preloaded/ebin/erlang.beam \ @@ -835,6 +843,15 @@ EMU_OBJS = \ $(OBJDIR)/beam_catches.o $(OBJDIR)/code_ix.o \ $(OBJDIR)/beam_ranges.o + +ifeq ($(USE_ESOCK), yes) + +# WE ARE USING ESOCK + +ESOCK_NIF_OBJS = \ + $(OBJDIR)/socket_nif.o \ + $(OBJDIR)/net_nif.o + ifneq ($(TARGET), win32) # These are *currently* only needed for non-win32, # since the nif-functions for socket and net are basically @@ -843,18 +860,20 @@ ESOCK_RUN_OBJS = \ $(OBJDIR)/socket_dbg.o \ $(OBJDIR)/socket_tarray.o \ $(OBJDIR)/socket_util.o -ifeq ($(USE_ESOCK), yes) -ESOCK_NIF_OBJS = \ - $(OBJDIR)/socket_nif.o \ - $(OBJDIR)/net_nif.o else -ESOCK_NIF_OBJS = \ - $(OBJDIR)/net_nif.o +ESOCK_RUN_OBJS = endif + else + +# WE ARE *NOT* USING ESOCK + +ESOCK_NIF_OBJS = ESOCK_RUN_OBJS = + endif + RUN_OBJS += \ $(OBJDIR)/erl_alloc.o $(OBJDIR)/erl_mtrace.o \ $(OBJDIR)/erl_alloc_util.o $(OBJDIR)/erl_goodfit_alloc.o \ diff --git a/erts/preloaded/ebin/erl_init.beam b/erts/preloaded/ebin/erl_init.beam Binary files differindex 81be5b021a..fed41173e2 100644 --- a/erts/preloaded/ebin/erl_init.beam +++ b/erts/preloaded/ebin/erl_init.beam diff --git a/erts/preloaded/ebin/net.beam b/erts/preloaded/ebin/net.beam Binary files differindex ebb1296b95..6b823ea0a4 100644 --- a/erts/preloaded/ebin/net.beam +++ b/erts/preloaded/ebin/net.beam diff --git a/erts/preloaded/src/erl_init.erl b/erts/preloaded/src/erl_init.erl index a650367c25..d209c4033b 100644 --- a/erts/preloaded/src/erl_init.erl +++ b/erts/preloaded/src/erl_init.erl @@ -35,8 +35,7 @@ start(Mod, BootArgs) -> erl_tracer:on_load(), prim_buffer:on_load(), prim_file:on_load(), - conditional_load(socket), % socket:on_load(), - net:on_load(), % This needs to be loaded since it contains 'other' funcs... + conditional_load(socket, [socket, net]), % socket:on_load(), net:on_load(), %% Proceed to the specified boot module run(Mod, boot, BootArgs). @@ -49,15 +48,22 @@ run(M, F, A) -> M:F(A) end. -conditional_load(Mod) -> - conditional_load(Mod, erlang:loaded()). +conditional_load(CondMod, Mods2Load) -> + conditional_load(CondMod, erlang:loaded(), Mods2Load). -conditional_load(_Mod, []) -> +conditional_load(_CondMod, [], _Mods2LOad) -> ok; -conditional_load(Mod, [Mod|_]) -> - Mod:on_load(); -conditional_load(Mod, [_|T]) -> - conditional_load(Mod, T). +conditional_load(CondMod, [CondMod|_], Mods2Load) -> + on_load(Mods2Load); +conditional_load(CondMod, [_|T], Mods2Load) -> + conditional_load(CondMod, T, Mods2Load). + +on_load([]) -> + ok; +on_load([Mod|Mods]) -> + Mod:on_load(), + on_load(Mods). + diff --git a/erts/preloaded/src/net.erl b/erts/preloaded/src/net.erl index a24b5c8ce3..0b069aa5c7 100644 --- a/erts/preloaded/src/net.erl +++ b/erts/preloaded/src/net.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2018-2018. All Rights Reserved. +%% Copyright Ericsson AB 2018-2019. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. @@ -334,3 +334,4 @@ nif_if_index2name(_Id) -> nif_if_names() -> erlang:nif_error(undef). + |