From 55685630a4c2edccda1954e4bfb2ee590a4467f9 Mon Sep 17 00:00:00 2001 From: Micael Karlberg Date: Mon, 17 Jun 2019 18:14:29 +0200 Subject: [esock] Documentation woes Still trying to make --disable-esock to work properly. Now the primary chore is the doc building. OTP-15765 --- erts/doc/src/Makefile | 22 ++++++++++- erts/doc/src/part.xml | 49 ------------------------- erts/doc/src/part.xml.src | 49 +++++++++++++++++++++++++ erts/doc/src/ref_man.xml | 58 ----------------------------- erts/doc/src/ref_man.xml.src | 57 +++++++++++++++++++++++++++++ erts/preloaded/ebin/erl_init.beam | Bin 2316 -> 2336 bytes erts/preloaded/src/erl_init.erl | 4 +- lib/kernel/doc/src/Makefile | 39 +++++++++++++++----- lib/kernel/doc/src/ref_man.xml | 72 ------------------------------------ lib/kernel/doc/src/ref_man.xml.src | 73 +++++++++++++++++++++++++++++++++++++ lib/kernel/doc/src/specs.xml | 1 + lib/kernel/src/net.erl | 43 +++++++++------------- 12 files changed, 251 insertions(+), 216 deletions(-) delete mode 100644 erts/doc/src/part.xml create mode 100644 erts/doc/src/part.xml.src delete mode 100644 erts/doc/src/ref_man.xml create mode 100644 erts/doc/src/ref_man.xml.src delete mode 100644 lib/kernel/doc/src/ref_man.xml create mode 100644 lib/kernel/doc/src/ref_man.xml.src diff --git a/erts/doc/src/Makefile b/erts/doc/src/Makefile index 0e35d7c79f..735084b345 100644 --- a/erts/doc/src/Makefile +++ b/erts/doc/src/Makefile @@ -49,8 +49,14 @@ XML_REF1_FILES = epmd.xml \ ifeq ($(USE_ESOCK), yes) XML_REF3_ESOCK_EFILES = socket.xml +XML_CHAPTER_ESOCK_EFILES = socket_usage.xml +ESOCK_USE_SOCKET_XML= +ESOCK_USE_SOCKET_USAGE_XML= else XML_REF3_ESOCK_EFILES = +XML_CHAPTER_ESOCK_EFILES = +ESOCK_USE_SOCKET_XML = +ESOCK_USE_SOCKET_USAGE_XML = endif XML_REF3_EFILES = \ @@ -99,7 +105,7 @@ XML_CHAPTER_FILES = \ driver.xml \ absform.xml \ inet_cfg.xml \ - socket_usage.xml \ + $(XML_CHAPTER_ESOCK_EFILES) \ erl_ext_dist.xml \ erl_dist_protocol.xml \ communication.xml \ @@ -164,7 +170,7 @@ $(HTMLDIR)/%.gif: %.gif $(XML_FIGURE_DIR)/%.png: ../../emulator/internal_doc/figures/%.png $(INSTALL_DATA) $< $@ -docs: figures man pdf html $(INFO_FILE) +docs: part ref_man figures man pdf html $(INFO_FILE) $(TOP_PDF_FILE): $(XML_FILES) @@ -174,6 +180,9 @@ html: gifs $(HTML_REF_MAN_FILE) man: $(MAN1_FILES) $(MAN3_FILES) +ref_man: ref_man.xml +part: part.xml + gifs: $(GIF_FILES:%=$(HTMLDIR)/%) $(INFO_FILE): $(INFO_FILE_SRC) $(ERL_TOP)/make/$(TARGET)/otp.mk @@ -201,6 +210,15 @@ $(SPECDIR)/specs_%.xml: $(XMLDIR)/%.xml: ../../emulator/internal_doc/%.md $(ERL_TOP)/make/emd2exml $(ERL_TOP)/make/emd2exml $< $@ +ref_man.xml: ref_man.xml.src + ($(PERL) -p -e 's?%ESOCK_USE_SOCKET_XML%?$(ESOCK_USE_SOCKET_XML)?' \ + $<) > $@ + +part.xml: part.xml.src + ($(PERL) -p -e 's?%ESOCK_USE_SOCKET_USAGE_XML%?$(ESOCK_USE_SOCKET_USAGE_XML)?' \ + $<) > $@ + + # ---------------------------------------------------- # Release Target # ---------------------------------------------------- diff --git a/erts/doc/src/part.xml b/erts/doc/src/part.xml deleted file mode 100644 index f0b8a00b90..0000000000 --- a/erts/doc/src/part.xml +++ /dev/null @@ -1,49 +0,0 @@ - - - - -
- - 19962018 - Ericsson AB. 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. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - - - ERTS User's Guide - Catrin Granbom - - 1997-05-15 - 4.5.2 - part.xml -
- - - - - - - - - - - - - - - - -
- diff --git a/erts/doc/src/part.xml.src b/erts/doc/src/part.xml.src new file mode 100644 index 0000000000..9b20beffad --- /dev/null +++ b/erts/doc/src/part.xml.src @@ -0,0 +1,49 @@ + + + + +
+ + 19962019 + Ericsson AB. 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. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + + + ERTS User's Guide + Catrin Granbom + + 1997-05-15 + 4.5.2 + part.xml +
+ + + + + + + + + + + + + + %ESOCK_USE_SOCKET_USAGE_XML% + + +
+ diff --git a/erts/doc/src/ref_man.xml b/erts/doc/src/ref_man.xml deleted file mode 100644 index 80cdcf9145..0000000000 --- a/erts/doc/src/ref_man.xml +++ /dev/null @@ -1,58 +0,0 @@ - - - - -
- - 19962018 - Ericsson AB. 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. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - - - ERTS Reference Manual - Lars Thorsén - - 1997-05-15 - 4.5.2 - application.xml -
- - - - - - - - - - - - - - - - - - - - - - - - - -
- diff --git a/erts/doc/src/ref_man.xml.src b/erts/doc/src/ref_man.xml.src new file mode 100644 index 0000000000..7dd003763c --- /dev/null +++ b/erts/doc/src/ref_man.xml.src @@ -0,0 +1,57 @@ + + + + +
+ + 19962019 + Ericsson AB. 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. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + + + ERTS Reference Manual + Lars Thorsén + + 1997-05-15 + 4.5.2 + application.xml +
+ + + + + + + + + + + + + + + + + + + + %ESOCK_USE_SOCKET_XML% + + + + +
+ diff --git a/erts/preloaded/ebin/erl_init.beam b/erts/preloaded/ebin/erl_init.beam index 1d54e0cead..bc7639781c 100644 Binary files a/erts/preloaded/ebin/erl_init.beam and b/erts/preloaded/ebin/erl_init.beam differ diff --git a/erts/preloaded/src/erl_init.erl b/erts/preloaded/src/erl_init.erl index 9fcb3969e4..dadf7dda6f 100644 --- a/erts/preloaded/src/erl_init.erl +++ b/erts/preloaded/src/erl_init.erl @@ -50,7 +50,9 @@ run(M, F, A) -> end. conditional_load(CondMod, Mods2Load) -> - conditional_load(CondMod, erlang:loaded(), Mods2Load). + Loaded = erlang:loaded(), + %% erlang:display({?MODULE, conditional_load, Loaded}), + conditional_load(CondMod, Loaded, Mods2Load). conditional_load(_CondMod, [], _Mods2LOad) -> ok; diff --git a/lib/kernel/doc/src/Makefile b/lib/kernel/doc/src/Makefile index 366631e912..817f592ad4 100644 --- a/lib/kernel/doc/src/Makefile +++ b/lib/kernel/doc/src/Makefile @@ -1,7 +1,7 @@ # # %CopyrightBegin% # -# Copyright Ericsson AB 1997-2018. All Rights Reserved. +# Copyright Ericsson AB 1997-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. @@ -37,10 +37,13 @@ RELSYSDIR = $(RELEASE_PATH)/lib/$(APPLICATION)-$(VSN) # ---------------------------------------------------- XML_APPLICATION_FILES = ref_man.xml -ifeq ($(USE_ESOCK), yes) +# The doc build has problems with if-defing out modules... +ifeq ($(USE_ESOCK),yes) XML_REF3_ESOCK_FILES = net.xml +ESOCK_USE_NET_XML= else XML_REF3_ESOCK_FILES = +ESOCK_USE_NET_XML = endif XML_REF3_FILES = application.xml \ @@ -120,6 +123,7 @@ SPECS_FILES = $(XML_REF3_FILES:%.xml=$(SPECDIR)/specs_%.xml) TOP_SPECS_FILE = specs.xml + # ---------------------------------------------------- # FIGURES # ---------------------------------------------------- @@ -146,7 +150,7 @@ SPECS_FLAGS = -I../../include $(HTMLDIR)/%: % $(INSTALL_DATA) $< $@ -docs: man pdf html +docs: ref_man man pdf html $(TOP_PDF_FILE): $(XML_FILES) @@ -156,19 +160,31 @@ html: images $(HTML_REF_MAN_FILE) man: $(MAN3_FILES) $(MAN4_FILES) $(MAN6_FILES) +ref_man: ref_man.xml + images: $(IMAGE_FILES:%=$(HTMLDIR)/%) +info: + @echo "XML_APPLICATION_FILES: $(XML_APPLICATION_FILES)" + @echo "XML_REF3_ESOCK_FILES: $(XML_REF3_ESOCK_FILES)" + @echo "XML_REF3_FILES: $(XML_REF3_FILES)" + @echo "XML_REF4_FILES: $(XML_REF4_FILES)" + @echo "XML_REF6_FILES: $(XML_REF6_FILES)" + @echo "XML_PART_FILES: $(XML_PART_FILES)" + @echo "XML_CHAPTER_FILES: $(XML_CHAPTER_FILES)" + @echo "BOOK_FILES: $(BOOK_FILES)" + debug opt: clean clean_docs: rm -rf $(HTMLDIR)/* rm -rf $(XMLDIR) - rm -f $(MAN3DIR)/* - rm -f $(MAN4DIR)/* - rm -f $(MAN6DIR)/* - rm -f $(TOP_PDF_FILE) $(TOP_PDF_FILE:%.pdf=%.fo) - rm -f $(SPECDIR)/* - rm -f errs core *~ *.eps + rm -f $(MAN3DIR)/* + rm -f $(MAN4DIR)/* + rm -f $(MAN6DIR)/* + rm -f $(TOP_PDF_FILE) $(TOP_PDF_FILE:%.pdf=%.fo) + rm -f $(SPECDIR)/* + rm -f errs core *~ *.eps $(SPECDIR)/specs_erl_prim_loader_stub.xml: $(gen_verbose)escript $(SPECS_EXTRACTOR) $(SPECS_FLAGS) \ @@ -183,6 +199,11 @@ $(SPECDIR)/specs_zlib_stub.xml: $(gen_verbose)escript $(SPECS_EXTRACTOR) $(SPECS_FLAGS) \ -o$(dir $@) -module zlib_stub +ref_man.xml: ref_man.xml.src + ($(PERL) -p -e 's?%ESOCK_USE_NET_XML%?$(ESOCK_USE_NET_XML)?' \ + $<) > $@ + + # ---------------------------------------------------- # Release Target # ---------------------------------------------------- diff --git a/lib/kernel/doc/src/ref_man.xml b/lib/kernel/doc/src/ref_man.xml deleted file mode 100644 index d3b947527f..0000000000 --- a/lib/kernel/doc/src/ref_man.xml +++ /dev/null @@ -1,72 +0,0 @@ - - - - -
- - 19962018 - Ericsson AB. 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. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - - - Kernel Reference Manual - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
diff --git a/lib/kernel/doc/src/ref_man.xml.src b/lib/kernel/doc/src/ref_man.xml.src new file mode 100644 index 0000000000..72e3409123 --- /dev/null +++ b/lib/kernel/doc/src/ref_man.xml.src @@ -0,0 +1,73 @@ + + + + +
+ + 19962019 + Ericsson AB. 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. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + + + Kernel Reference Manual + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + %ESOCK_USE_NET_XML% + + + + + + + + + +
diff --git a/lib/kernel/doc/src/specs.xml b/lib/kernel/doc/src/specs.xml index b8c25ca53b..9e258910db 100644 --- a/lib/kernel/doc/src/specs.xml +++ b/lib/kernel/doc/src/specs.xml @@ -26,6 +26,7 @@ + diff --git a/lib/kernel/src/net.erl b/lib/kernel/src/net.erl index ac8b600e4b..01409c736a 100644 --- a/lib/kernel/src/net.erl +++ b/lib/kernel/src/net.erl @@ -71,31 +71,24 @@ -ifdef(USE_ESOCK). --type name_info_flags() :: prim_net:name_info_flags(). --type name_info_flag() :: prim_net:name_info_flag(). --type name_info_flag_ext() :: prim_net:name_info_flag_ext(). --type name_info() :: prim_net:name_info(). --type address_info() :: prim_net:address_info(). --type network_interface_name() :: prim_net:network_interface_name(). --type network_interface_index() :: prim_net:network_interface_index(). - -%% -type name_info_flags() :: [name_info_flag()|name_info_flag_ext()]. -%% -type name_info_flag() :: namereqd | -%% dgram | -%% nofqdn | -%% numerichost | -%% nomericserv. -%% -type name_info_flag_ext() :: idn | -%% idna_allow_unassigned | -%% idna_use_std3_ascii_rules. -%% -type name_info() :: #{host := string(), -%% service := string()}. -%% -type address_info() :: #{family := socket:domain(), -%% socktype := socket:type(), -%% protocol := socket:protocol(), -%% address := socket:sockaddr()}. -%% -type network_interface_name() :: string(). -%% -type network_interface_index() :: non_neg_integer(). + +-type name_info_flags() :: [name_info_flag()|name_info_flag_ext()]. +-type name_info_flag() :: namereqd | + dgram | + nofqdn | + numerichost | + nomericserv. +-type name_info_flag_ext() :: idn | + idna_allow_unassigned | + idna_use_std3_ascii_rules. +-type name_info() :: #{host := string(), + service := string()}. +-type address_info() :: #{family := socket:domain(), + socktype := socket:type(), + protocol := socket:protocol(), + address := socket:sockaddr()}. +-type network_interface_name() :: string(). +-type network_interface_index() :: non_neg_integer(). -endif. -- cgit v1.2.3