anchor.diff:      Ext = filename:extension(Source),
       filename:rootname(Source, Ext) ++ ".o".
   
  -so_name(Config, AppFile) ->
  +so_specs(Config, AppFile, Bins) ->
       %% Check config to see if a custom so_name has been specified
  -    PortName = case rebar_config:get(Config, so_name, undefined) of
  +    ?INFO("config ~p\n", [Config]),
  +    case rebar_config:get(Config, so_specs, undefined) of
                      undefined ->
                          %% Get the app name, which we'll use to
                          %% generate the linked port driver name
                          case rebar_app_utils:load_app_file(AppFile) of
                              {ok, AppName, _} ->
  -                               lists:concat([AppName, "_drv.so"]);
  +                               SoName = ?FMT("priv/~s", [lists:concat([AppName, "_drv.so"])]),
  +                               [{SoName, Bins}];
                              error ->
                                  ?FAIL
                          end;
  -                   Soname ->
  -                       Soname
  -               end,
  -
  -    %% Construct the driver name
  -    ?FMT("priv/~s", [PortName]).
  +                   SoSpecs -> SoSpecs
  +               end.
  
positive.code: expand_sources([Spec | Rest], Acc) ->
      Acc2 = filelib:wildcard(Spec) ++ Acc,
      expand_sources(Rest, Acc2).
  
  run_precompile_hook(Config, Env) ->
      case rebar_config:get(Config, port_pre_script, undefined) of
  
negative.code:     rebar_file_utils:delete_each([source_to_bin(S) || S <- Sources]),
  
      %% Delete the .so file
      rebar_file_utils:delete_each(lists:map(fun({SoName,_}) -> SoName end, so_specs(Config, AppFile, expand_objects(Sources)))),
  
      %% Run the cleanup script, if it exists
      run_cleanup_hook(Config).
  