Skip to content

Commit 6c5f87c

Browse files
committed
Merge branch 'maint'
2 parents 81c2d16 + 29124f2 commit 6c5f87c

File tree

3 files changed

+68
-23
lines changed

3 files changed

+68
-23
lines changed

lib/crypto/configure

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7581,10 +7581,12 @@ then :
75817581
then :
75827582

75837583
lib_bits=64
7584+
arch=64
75847585

75857586
else case e in #(
75867587
e)
75877588
lib_bits=32
7589+
arch=86
75887590
;;
75897591
esac
75907592
fi
@@ -7609,6 +7611,26 @@ then :
76097611

76107612
fi
76117613

7614+
# openssl 3.5+
7615+
if test -f "$dir/lib/VC/x$arch/MD/libcrypto_static.lib"
7616+
then :
7617+
7618+
static_crypto_lib_name=libcrypto
7619+
static_ssl_lib_name="libssl"
7620+
static_extra_libs="$static_extra_libs -lCRYPT32 -lWS2_32"
7621+
static_lib_dir="$dir/lib/VC/x$arch/MD"
7622+
found_static_lib=yes
7623+
fi
7624+
if test -f "$dir/lib/VC/x$arch/MD/libcrypto.lib"
7625+
then :
7626+
7627+
dynamic_crypto_lib_name=libcrypto
7628+
dynamic_ssl_lib_name="libssl"
7629+
dynamic_runtime_lib_dir="$rdir/lib/VC/x$arch/MD"
7630+
dynamic_lib_dir="$dir/lib/VC/x$arch/MD"
7631+
found_dynamic_lib=yes
7632+
fi
7633+
76127634
else case e in #(
76137635
e)
76147636
# Not windows...
@@ -8108,10 +8130,12 @@ then :
81088130
then :
81098131

81108132
lib_bits=64
8133+
arch=64
81118134

81128135
else case e in #(
81138136
e)
81148137
lib_bits=32
8138+
arch=86
81158139
;;
81168140
esac
81178141
fi
@@ -8136,6 +8160,26 @@ then :
81368160

81378161
fi
81388162

8163+
# openssl 3.5+
8164+
if test -f "$dir/lib/VC/x$arch/MD/libcrypto_static.lib"
8165+
then :
8166+
8167+
static_crypto_lib_name=libcrypto
8168+
static_ssl_lib_name="libssl"
8169+
static_extra_libs="$static_extra_libs -lCRYPT32 -lWS2_32"
8170+
static_lib_dir="$dir/lib/VC/x$arch/MD"
8171+
found_static_lib=yes
8172+
fi
8173+
if test -f "$dir/lib/VC/x$arch/MD/libcrypto.lib"
8174+
then :
8175+
8176+
dynamic_crypto_lib_name=libcrypto
8177+
dynamic_ssl_lib_name="libssl"
8178+
dynamic_runtime_lib_dir="$rdir/lib/VC/x$arch/MD"
8179+
dynamic_lib_dir="$dir/lib/VC/x$arch/MD"
8180+
found_dynamic_lib=yes
8181+
fi
8182+
81398183
else case e in #(
81408184
e)
81418185
# Not windows...

lib/stdlib/src/man_docs.erl

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -67,16 +67,7 @@ markdown_to_manpage(Markdown, Path, Section) ->
6767
markdown_to_manpage1(shell_docs_markdown:parse_md(Markdown), Path, Section).
6868
markdown_to_manpage1(MarkdownChunks, Path, Section) ->
6969
Path1 = filename:absname(Path),
70-
App = case filename:split(string:prefix(Path1, os:getenv("ERL_TOP"))) of
71-
["/", "lib", AppStr | _] ->
72-
list_to_atom(AppStr);
73-
["lib", AppStr | _] ->
74-
list_to_atom(AppStr);
75-
["/", "erts" | _] ->
76-
list_to_atom("erts");
77-
["nomatch"] ->
78-
error("ERL_TOP environment variable doesn't match the PATH " ++ Path)
79-
end,
70+
App = get_app(Path1),
8071
Version = case application:load(App) of
8172
ok -> {ok,Vsn} = application:get_key(App, vsn), Vsn;
8273
{error, {"no such file or directory","erts.app"}} -> erlang:system_info(version);
@@ -91,6 +82,19 @@ markdown_to_manpage1(MarkdownChunks, Path, Section) ->
9182
I = conv(MarkdownChunks, Name),
9283
iolist_to_binary([Prelude|I]).
9384

85+
get_app(Path) ->
86+
case string:split(Path, "/erts/") of
87+
[_, _] -> list_to_atom("erts");
88+
_ -> case string:split(Path, "/lib/") of
89+
[_, Rest] ->
90+
case string:split(Rest, "/") of
91+
[AppStr, _] -> list_to_atom(AppStr);
92+
_ -> error("Could not find app from path " ++ Path)
93+
end;
94+
_ -> error("Could not find app from path " ++ Path)
95+
end
96+
end.
97+
9498
get_name([{h1,_,[Name]}|_], _) when is_binary(Name) ->
9599
Name;
96100
get_name(_, Default) when is_binary(Default) ->

lib/stdlib/test/shell_docs_SUITE.erl

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -319,17 +319,16 @@ render_callback(_Config) ->
319319
ok.
320320

321321
render_man(_Config) ->
322-
Old_ERL_TOP = os:getenv("ERL_TOP"),
323-
case Old_ERL_TOP of
324-
false -> os:putenv("ERL_TOP", code:root_dir());
325-
_ -> ok
326-
end,
327322
docsmap(
328323
fun(Mod, #docs_v1{metadata = Metadata} = D) ->
329324
try
330325
Path1 = case Metadata of
331326
#{source_path := Path} -> Path;
332-
#{} -> proplists:get_value(source, proplists:get_value(compile, Mod:module_info()))
327+
#{} -> try
328+
proplists:get_value(source, proplists:get_value(compile, Mod:module_info()))
329+
catch _:_ ->
330+
throw({error, no_path_to_source})
331+
end
333332
end,
334333
man_docs:module_to_manpage(Mod, Path1, D, "3")
335334
catch _E:R:ST ->
@@ -338,10 +337,6 @@ render_man(_Config) ->
338337
exit(R)
339338
end
340339
end),
341-
case Old_ERL_TOP of
342-
false -> os:unsetenv("ERL_TOP");
343-
_ -> os:putenv("ERL_TOP", Old_ERL_TOP)
344-
end,
345340
ok.
346341

347342
docsmap(Fun) ->
@@ -365,9 +360,11 @@ docsmap(Fun) ->
365360
try
366361
_ = Fun(Mod, Docs),
367362
{ok, self(), Mod}
368-
catch E:R:ST ->
369-
io:format("Failed to render ~p~n~p:~p:~p~n",[Mod,E,R,ST]),
370-
erlang:raise(E,R,ST)
363+
catch throw:{error, no_path_to_source} ->
364+
ok;
365+
E:R:ST ->
366+
io:format("Failed to render ~p~n~p:~p:~p~n",[Mod,E,R,ST]),
367+
erlang:raise(E,R,ST)
371368
end
372369
end
373370
end,

0 commit comments

Comments
 (0)