anchor.diff:                        Undefs),
       %% diameter_tcp does call ssl despite the latter not being listed
       %% as a dependency in the app file since ssl is only required for
  -    %% TLS security: it's up to a client who wants TLS it to start
  -    %% ssl.
  -
  -    %% Ensure that compiler modules don't call runtime modules.
  -    [] = lists:filter(fun nok_compiler_dependency/1, CTdeps),
  +    %% TLS security: it's up to a client who wants TLS to start ssl.
  +
  +    %% Ensure that only runtime or info modules call runtime modules.
  +    %% It's not strictly necessary that diameter compiler modules not
  +    %% depend on other diameter modules but it's a simple source of
  +    %% build errors if not properly encoded in the makefile so guard
  +    %% against it.
  +    [] = (RTmods -- Mods) -- ?INFO_MODULES,
  +
  +    %% Ensure that runtime modules don't call compiler modules.
  +    CTmods = CTmods -- Mods,
   
       %% Ensure that runtime modules only call other runtime modules, or
       %% applications declared as in runtime_dependencies in the app
       %% file. Note that the declared application versions are ignored
       %% since we only know what we can see now.
  -    [] = lists:filter(fun(M) -> not ok_runtime_dependency(M, Mods, Deps) end,
  -                      RTdeps).
  +    [] = lists:filter(fun(M) -> not lists:member(app(M), Deps) end,
  +                      RTdeps -- Mods).
   
   unversion(App) ->
       T = lists:dropwhile(fun is_vsn_ch/1, lists:reverse(App)),
  
positive.code: 
  is_vsn_ch(C) ->
      $0 =< C andalso C =< $9 orelse $. == C.
  
  %% It's not strictly necessary that diameter compiler modules not
  %% depend on other diameter modules but it's a simple source of build
  %% errors if not properly encoded in the makefile so guard against it.
  nok_compiler_dependency(Mod) ->
      is_diameter(Mod) andalso not lists:member(Mod, ?COMPILER_MODULES).
  
  ok_runtime_dependency(Mod, Mods, Apps) ->
      lists:member(app(Mod), Apps)
          orelse (is_diameter(Mod) andalso lists:member(Mod, Mods)).
  
  is_diameter(Mod) ->
      lists:prefix("diameter", atom_to_list(Mod)).
  
  app('$M_EXPR') -> %% could be anything but assume it's ok
      "erts";
  
negative.code:                            diameter_exprecs,
                             diameter_make]).
  
  -define(INFO_MODULES, [diameter_dbg,
                         diameter_info]).
  
  %% ===========================================================================
  