erlang/erlang.patch

Tue, 02 Jul 2013 17:58:45 +0200

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 02 Jul 2013 17:58:45 +0200
changeset 780
0a61f30eebd4
child 781
25504c2d46b1
permissions
-rw-r--r--

Import package vendor original specs for necessary manipulations.

michael@780 1 Index: erts/emulator/Makefile.in
michael@780 2 --- erts/emulator/Makefile.in.orig 2010-12-07 16:07:22.000000000 +0100
michael@780 3 +++ erts/emulator/Makefile.in 2010-12-09 17:06:47.000000000 +0100
michael@780 4 @@ -617,7 +617,7 @@
michael@780 5
michael@780 6
michael@780 7 $(OBJDIR)/%.o: beam/%.c
michael@780 8 - $(CC) $(subst -O2, $(GEN_OPT_FLGS), $(CFLAGS)) $(INCLUDES) -c $< -o $@
michael@780 9 + $(CC) $(INCLUDES) $(subst -O2, $(GEN_OPT_FLGS), $(CFLAGS)) -c $< -o $@
michael@780 10
michael@780 11 $(OBJDIR)/%.o: $(TARGET)/%.c
michael@780 12 $(CC) $(CFLAGS) $(INCLUDES) -Idrivers/common -c $< -o $@
michael@780 13 Index: erts/emulator/hipe/hipe_x86.c
michael@780 14 --- erts/emulator/hipe/hipe_x86.c.orig 2010-12-07 16:07:22.000000000 +0100
michael@780 15 +++ erts/emulator/hipe/hipe_x86.c 2010-12-09 17:23:16.000000000 +0100
michael@780 16 @@ -130,7 +130,7 @@
michael@780 17 abort();
michael@780 18 map_start = mmap(map_hint, map_bytes,
michael@780 19 PROT_EXEC|PROT_READ|PROT_WRITE,
michael@780 20 - MAP_PRIVATE|MAP_ANONYMOUS
michael@780 21 + MAP_PRIVATE|MAP_ANON
michael@780 22 #ifdef __x86_64__
michael@780 23 |MAP_32BIT
michael@780 24 #endif
michael@780 25 Index: lib/erl_interface/src/connect/ei_resolve.c
michael@780 26 --- lib/erl_interface/src/connect/ei_resolve.c.orig 2010-12-07 16:07:22.000000000 +0100
michael@780 27 +++ lib/erl_interface/src/connect/ei_resolve.c 2010-12-09 17:23:16.000000000 +0100
michael@780 28 @@ -54,6 +54,10 @@
michael@780 29 #include "ei_resolve.h"
michael@780 30 #include "ei_locking.h"
michael@780 31
michael@780 32 +#if defined(HAVE_GETHOSTBYNAME_R) && defined(__FreeBSD__)
michael@780 33 +#undef HAVE_GETHOSTBYNAME_R
michael@780 34 +#endif
michael@780 35 +
michael@780 36 #ifdef HAVE_GETHOSTBYNAME_R
michael@780 37
michael@780 38 void ei_init_resolve(void)
michael@780 39 Index: lib/gs/src/tool_utils.erl
michael@780 40 --- lib/gs/src/tool_utils.erl.orig 2010-12-07 16:07:22.000000000 +0100
michael@780 41 +++ lib/gs/src/tool_utils.erl 2010-12-09 17:23:16.000000000 +0100
michael@780 42 @@ -40,6 +40,9 @@
michael@780 43 }).
michael@780 44
michael@780 45
michael@780 46 +%% Browser executable list (openURL command line protocol required)
michael@780 47 +-define(BROWSERS, ["netscape", "mozilla", "MozillaFirebird", "opera", "firefox", "seamonkey"]).
michael@780 48 +
michael@780 49 %%----------------------------------------------------------------------
michael@780 50 %% open_help(Parent, File)
michael@780 51 %% Parent = gsobj() (GS root object or parent window)
michael@780 52 @@ -80,7 +83,7 @@
michael@780 53 {unix,Type} ->
michael@780 54 case Type of
michael@780 55 darwin -> "open " ++ File;
michael@780 56 - _Else -> "netscape -remote \"openURL(file:" ++ File ++ ")\""
michael@780 57 + _Else -> unix_url_command("file:" ++ File)
michael@780 58 end;
michael@780 59 {win32,_AnyType} ->
michael@780 60 "start " ++ filename:nativename(File);
michael@780 61 @@ -95,7 +98,7 @@
michael@780 62 {unix,Type} ->
michael@780 63 case Type of
michael@780 64 darwin -> "open " ++ File;
michael@780 65 - _Else -> "netscape -remote \"openURL(file:" ++ File ++ ")\""
michael@780 66 + _Else -> unix_url_command("file:" ++ File)
michael@780 67 end;
michael@780 68 {win32,_AnyType} ->
michael@780 69 "netscape.exe -h " ++ regexp:gsub(File,"\\\\","/");
michael@780 70 @@ -429,3 +432,53 @@
michael@780 71 [Last];
michael@780 72 insert_newlines(Other) ->
michael@780 73 Other.
michael@780 74 +
michael@780 75 +%% find_browser(BrowserList) => string() | false
michael@780 76 +%% BrowserList - [string()]
michael@780 77 +%% Given a list of basenames, find the first available executable.
michael@780 78 +
michael@780 79 +find_browser([]) ->
michael@780 80 + false;
michael@780 81 +
michael@780 82 +find_browser([H | T]) ->
michael@780 83 + case os:find_executable(H) of
michael@780 84 + false ->
michael@780 85 + find_browser(T);
michael@780 86 + Browser ->
michael@780 87 + Browser
michael@780 88 + end.
michael@780 89 +
michael@780 90 +%% unix_url_command(URL) => string()
michael@780 91 +%% URL - string()
michael@780 92 +%% Open an URL, using a browser which supports the openURL command
michael@780 93 +%% line protocol. If no browser is found, the empty string will be
michael@780 94 +%% returned.
michael@780 95 +
michael@780 96 +unix_url_command(URL) ->
michael@780 97 + Template = "BROWSER -remote \"openURL(" ++ URL ++ ")\" || BROWSER " ++ URL ++ "&",
michael@780 98 +
michael@780 99 + case os:getenv("BROWSER") of
michael@780 100 + false ->
michael@780 101 + %% look for a compatible browser
michael@780 102 + case find_browser(?BROWSERS) of
michael@780 103 + false ->
michael@780 104 + "";
michael@780 105 + Browser ->
michael@780 106 + case regexp:gsub(Template, "BROWSER", Browser) of
michael@780 107 + {ok, Command, 0} ->
michael@780 108 + %% Template does not contain "BROWSER" placeholder
michael@780 109 + "";
michael@780 110 + {ok, Command, _} ->
michael@780 111 + Command
michael@780 112 + end
michael@780 113 + end;
michael@780 114 +
michael@780 115 + Value ->
michael@780 116 + case regexp:gsub(Template, "BROWSER", Value) of
michael@780 117 + {ok, Command2, 0} ->
michael@780 118 + %% no placeholder
michael@780 119 + "";
michael@780 120 + {ok, Command2, _} ->
michael@780 121 + Command2
michael@780 122 + end
michael@780 123 + end.
michael@780 124 Index: lib/hipe/regalloc/Makefile
michael@780 125 --- lib/hipe/regalloc/Makefile.orig 2010-12-07 16:07:22.000000000 +0100
michael@780 126 +++ lib/hipe/regalloc/Makefile 2010-12-09 17:23:16.000000000 +0100
michael@780 127 @@ -46,7 +46,6 @@
michael@780 128 hipe_node_sets hipe_spillcost hipe_reg_worklists \
michael@780 129 hipe_adj_list \
michael@780 130 hipe_temp_map \
michael@780 131 - hipe_optimistic_regalloc \
michael@780 132 hipe_coalescing_regalloc \
michael@780 133 hipe_graph_coloring_regalloc \
michael@780 134 hipe_regalloc_loop \
michael@780 135 Index: lib/stdlib/src/calendar.erl
michael@780 136 --- lib/stdlib/src/calendar.erl.orig 2010-12-07 16:07:22.000000000 +0100
michael@780 137 +++ lib/stdlib/src/calendar.erl 2010-12-09 17:23:16.000000000 +0100
michael@780 138 @@ -216,11 +216,19 @@
michael@780 139
michael@780 140 -spec local_time_to_universal_time_dst(t_datetime1970()) -> [t_datetime1970()].
michael@780 141 local_time_to_universal_time_dst(DateTime) ->
michael@780 142 - UtDst = erlang:localtime_to_universaltime(DateTime, true),
michael@780 143 - Ut = erlang:localtime_to_universaltime(DateTime, false),
michael@780 144 %% Reverse check the universal times
michael@780 145 - LtDst = erlang:universaltime_to_localtime(UtDst),
michael@780 146 - Lt = erlang:universaltime_to_localtime(Ut),
michael@780 147 + {UtDst, LtDst} =
michael@780 148 + try
michael@780 149 + UtDst0 = erlang:localtime_to_universaltime(DateTime, true),
michael@780 150 + {UtDst0, erlang:universaltime_to_localtime(UtDst0)}
michael@780 151 + catch error:badarg -> {error, error}
michael@780 152 + end,
michael@780 153 + {Ut, Lt} =
michael@780 154 + try
michael@780 155 + Ut0 = erlang:localtime_to_universaltime(DateTime, false),
michael@780 156 + {Ut0, erlang:universaltime_to_localtime(Ut0)}
michael@780 157 + catch error:badarg -> {error, error}
michael@780 158 + end,
michael@780 159 %% Return the valid universal times
michael@780 160 case {LtDst,Lt} of
michael@780 161 {DateTime,DateTime} when UtDst =/= Ut ->
michael@780 162 Index: lib/tools/emacs/test.erl
michael@780 163 Index: lib/wx/configure
michael@780 164 --- lib/wx/configure.orig 2010-12-07 16:07:22.000000000 +0100
michael@780 165 +++ lib/wx/configure 2010-12-09 17:23:16.000000000 +0100
michael@780 166 @@ -3910,7 +3910,7 @@
michael@780 167 ;;
michael@780 168 *)
michael@780 169 DEBUG_CFLAGS="-g -Wall -fPIC -DDEBUG $CFLAGS"
michael@780 170 - CFLAGS="-g -Wall -O2 -fPIC -fomit-frame-pointer -fno-strict-aliasing $CFLAGS"
michael@780 171 + CFLAGS="-Wall -fPIC -fomit-frame-pointer -fno-strict-aliasing $CFLAGS %%CFLAGS%%"
michael@780 172 ;;
michael@780 173 esac
michael@780 174

mercurial