Hello community,

here is the log from the commit of package erlang-rebar for openSUSE:Factory 
checked in at 2016-10-02 00:09:15
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/erlang-rebar (Old)
 and      /work/SRC/openSUSE:Factory/.erlang-rebar.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "erlang-rebar"

Changes:
--------
--- /work/SRC/openSUSE:Factory/erlang-rebar/erlang-rebar-testsuite.changes      
2016-05-30 09:56:08.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.erlang-rebar.new/erlang-rebar-testsuite.changes 
2016-10-02 00:09:16.000000000 +0200
@@ -1,0 +2,22 @@
+Fri Sep 30 12:59:14 UTC 2016 - [email protected]
+
+- Update to version 2.6.4+git20160922.576e121:
+  * Revert 'Treat port env vars as expandable only if they self reference'
+  * Add necessary missing OSX flags for port driver linking
+  * Prepare release 2.6.2
+  * qc: lift experimental notice
+  * port_compiler: consistently format default_env/0
+  * Introduce and use compat random number module
+  * Add an additional check for the existence of a 'rebar.beam' file during 
bootstrap run. Bootstrap fails on first run without any .beam files in the ebin 
folder.
+  * port_compiler: generate clang compilation db
+  * port_compiler: clean up compile_each()
+  * port_compiler: auto-select C++ specific link template
+  * Prepare release 2.6.3
+  * Fix cdb processing when a file is skipped
+  * rebar_utils: restore blank line
+  * port_compiler: fix handling of multiple specs
+  * Prepare release 2.6.4
+  * Remove superfluous space in unabbrev error msg
+  * Continuous integration on OTP 19.1
+
+-------------------------------------------------------------------
erlang-rebar.changes: same change

Old:
----
  rebar-2.6.1+git20160413.9281b84.tar.bz2

New:
----
  rebar-2.6.4+git20160922.576e121.tar.bz2

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ erlang-rebar-testsuite.spec ++++++
--- /var/tmp/diff_new_pack.QXY4be/_old  2016-10-02 00:09:17.000000000 +0200
+++ /var/tmp/diff_new_pack.QXY4be/_new  2016-10-02 00:09:17.000000000 +0200
@@ -19,7 +19,7 @@
 Name:           erlang-rebar-testsuite
 %define normal_build    ("%{name}" == "erlang-rebar")
 %define testsuite_build ("%{name}" == "erlang-rebar-testsuite")
-Version:        2.6.1+git20160413.9281b84
+Version:        2.6.4+git20160922.576e121
 Release:        0
 %define mod_ver %(echo "%{version}" | cut -d "+" -f1)
 Summary:        A sophisticated build-tool for Erlang projects that follows 
OTP principles

++++++ erlang-rebar.spec ++++++
--- /var/tmp/diff_new_pack.QXY4be/_old  2016-10-02 00:09:17.000000000 +0200
+++ /var/tmp/diff_new_pack.QXY4be/_new  2016-10-02 00:09:17.000000000 +0200
@@ -19,7 +19,7 @@
 Name:           erlang-rebar
 %define normal_build    ("%{name}" == "erlang-rebar")
 %define testsuite_build ("%{name}" == "erlang-rebar-testsuite")
-Version:        2.6.1+git20160413.9281b84
+Version:        2.6.4+git20160922.576e121
 Release:        0
 %define mod_ver %(echo "%{version}" | cut -d "+" -f1)
 Summary:        A sophisticated build-tool for Erlang projects that follows 
OTP principles

++++++ _servicedata ++++++
--- /var/tmp/diff_new_pack.QXY4be/_old  2016-10-02 00:09:17.000000000 +0200
+++ /var/tmp/diff_new_pack.QXY4be/_new  2016-10-02 00:09:17.000000000 +0200
@@ -1,4 +1,4 @@
 <servicedata>
 <service name="tar_scm">
             <param name="url">git://github.com/rebar/rebar.git</param>
-          <param 
name="changesrevision">9281b848f563e4928b565fab57b610c7368c0be6</param></service></servicedata>
\ No newline at end of file
+          <param 
name="changesrevision">a8d17f9c15cb08402dd8638b4a1d174ee9b68892</param></service></servicedata>
\ No newline at end of file

++++++ rebar-2.6.1+git20160413.9281b84.tar.bz2 -> 
rebar-2.6.4+git20160922.576e121.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/rebar-2.6.1+git20160413.9281b84/.travis.yml 
new/rebar-2.6.4+git20160922.576e121/.travis.yml
--- old/rebar-2.6.1+git20160413.9281b84/.travis.yml     2016-05-09 
22:45:59.000000000 +0200
+++ new/rebar-2.6.4+git20160922.576e121/.travis.yml     2016-09-22 
13:01:52.000000000 +0200
@@ -10,6 +10,7 @@
   - R14B03
   - 17.0
   - 18.0
+  - 19.1
 before_script:
   - hostname -f
   - cc -v
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/rebar-2.6.1+git20160413.9281b84/RELEASE-NOTES.md 
new/rebar-2.6.4+git20160922.576e121/RELEASE-NOTES.md
--- old/rebar-2.6.1+git20160413.9281b84/RELEASE-NOTES.md        2016-05-09 
22:45:59.000000000 +0200
+++ new/rebar-2.6.4+git20160922.576e121/RELEASE-NOTES.md        2016-09-22 
13:01:52.000000000 +0200
@@ -1,3 +1,46 @@
+# 2.6.4
+
+* rebar/619: [Fix cdb processing when a file is 
skipped](https://github.com/rebar/rebar/pull/619)
+
+# 2.6.3
+
+* rebar/610: [qc: lift experimental 
notice](https://github.com/rebar/rebar/pull/610)
+* rebar/611: [port_compiler: consistently format 
default_env/0](https://github.com/rebar/rebar/pull/611)
+* rebar/612: [Introduce and use compat random number 
module](https://github.com/rebar/rebar/pull/612)
+* rebar/614: [Add an additional check for the existence of a 'rebar.beam' 
file](https://github.com/rebar/rebar/pull/614)
+* rebar/615: [port_compiler: generate clang compilation 
db](https://github.com/rebar/rebar/pull/615)
+* rebar/616: [port_compiler: clean up 
compile_each()](https://github.com/rebar/rebar/pull/616)
+* rebar/617: [port_compiler: auto-select C++ specific link 
template](https://github.com/rebar/rebar/pull/617)
+
+# 2.6.2
+
+* rebar/532: [Automatically clean neotoma-generated erl files, regression 
test](https://github.com/rebar/rebar/pull/532)
+* rebar/549: [Add Windows continuous integration through 
AppVeyor](https://github.com/rebar/rebar/pull/549)
+* rebar/551: [fprof: document Cachegrind 
support](https://github.com/rebar/rebar/pull/551)
+* rebar/556: [fprof: further document Cachegrind 
support](https://github.com/rebar/rebar/pull/556)
+* rebar/557: [Fix windows eunit tests](https://github.com/rebar/rebar/pull/557)
+* rebar/558: [Add qualified name tests docs (see pr 
#119)](https://github.com/rebar/rebar/pull/558)
+* rebar/560: [Lock retest dependency](https://github.com/rebar/rebar/pull/560)
+* rebar/562: [Add support for Windows integration 
testing](https://github.com/rebar/rebar/pull/562)
+* rebar/567: [Allow windows release to use etc conf 
dir](https://github.com/rebar/rebar/pull/567)
+* rebar/570: [xref: fix dialyzer warning introduced in 
69802f63120](https://github.com/rebar/rebar/pull/570)
+* rebar/573: [Provide additional debug logging on relup 
generation](https://github.com/rebar/rebar/pull/573)
+* rebar/578: [Add the latest OTP 18 version to the Travis 
build](https://github.com/rebar/rebar/pull/578)
+* rebar/580: [Additional Common Test regression 
tests](https://github.com/rebar/rebar/pull/580)
+* rebar/581: [Update retest dependency 
url](https://github.com/rebar/rebar/pull/581)
+* rebar/586: [Ensure ebin created for dia 
compiler](https://github.com/rebar/rebar/pull/586)
+* rebar/587: [rebar_require_vsn: Update regexp to account for newer OTP 
versions](https://github.com/rebar/rebar/pull/587)
+* rebar/588: [Look for ct .spec files in the ct_dir that was 
specified](https://github.com/rebar/rebar/pull/588)
+* rebar/589: [Introduce REBAR_DEPS_PREFER_LIBS env variable to alter search 
behaviour](https://github.com/rebar/rebar/pull/589)
+* rebar/590: [Treat port env vars as expandable only if they self 
reference](https://github.com/rebar/rebar/pull/590)
+* rebar/591: [Fix/eunit tests surefire 
crash](https://github.com/rebar/rebar/pull/591)
+* rebar/594: [Introduce REBAR_VSN_CACHE_FILE env variable to load/save vsn 
cache](https://github.com/rebar/rebar/pull/594)
+* rebar/599: [Fix bug when running gcc in 
cross_sizeof](https://github.com/rebar/rebar/pull/599)
+* rebar/602: [Support full-source rebar3-style deps (deps without Version 
Regexes)](https://github.com/rebar/rebar/pull/602)
+* rebar/603: [add deprecated message](https://github.com/rebar/rebar/pull/603)
+* rebar/605: [Add necessary OSX flags for port driver 
linking](https://github.com/rebar/rebar/pull/605)
+* rebar/606: [Revert 'Treat port env vars as expandable only if they self 
reference'](https://github.com/rebar/rebar/pull/606)
+
 # 2.6.1
 
 * rebar/514: [Add license to relnotes tool per reviewer 
request](https://github.com/rebar/rebar/pull/514)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/rebar-2.6.1+git20160413.9281b84/bootstrap 
new/rebar-2.6.4+git20160922.576e121/bootstrap
--- old/rebar-2.6.1+git20160413.9281b84/bootstrap       2016-05-09 
22:45:59.000000000 +0200
+++ new/rebar-2.6.4+git20160922.576e121/bootstrap       2016-09-22 
13:01:52.000000000 +0200
@@ -24,7 +24,10 @@
         true ->
             rm("ebin/*.beam");
         false ->
-            rm("ebin/rebar.beam")
+            case filelib:is_file("ebin/rebar.beam") of
+               true -> rm("ebin/rebar.beam");
+               false -> io:fwrite("No beam files found.~n")
+            end
     end,
 
     %% Add check for debug flag
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/rebar-2.6.1+git20160413.9281b84/ebin/rebar.app 
new/rebar-2.6.4+git20160922.576e121/ebin/rebar.app
--- old/rebar-2.6.1+git20160413.9281b84/ebin/rebar.app  2016-05-09 
22:45:59.000000000 +0200
+++ new/rebar-2.6.4+git20160922.576e121/ebin/rebar.app  2016-09-22 
13:01:52.000000000 +0200
@@ -3,7 +3,7 @@
 
 {application, rebar,
  [{description, "Rebar: Erlang Build Tool"},
-  {vsn, "2.6.1"},
+  {vsn, "2.6.4"},
   {modules, [ rebar,
               rebar_abnfc_compiler,
               rebar_app_utils,
@@ -46,7 +46,8 @@
               rebar_metacmds,
               rebar_getopt,
               rebar_mustache,
-              rmemo ]},
+              rmemo,
+              rebar_rand_compat ]},
   {registered, []},
   {applications,
    [
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/rebar-2.6.1+git20160413.9281b84/inttest/port/port_rt.erl 
new/rebar-2.6.4+git20160922.576e121/inttest/port/port_rt.erl
--- old/rebar-2.6.1+git20160413.9281b84/inttest/port/port_rt.erl        
2016-05-09 22:45:59.000000000 +0200
+++ new/rebar-2.6.4+git20160922.576e121/inttest/port/port_rt.erl        
2016-09-22 13:01:52.000000000 +0200
@@ -48,6 +48,7 @@
     %% test.so is created during first compile
     ?assertEqual(0, filelib:last_modified("priv/test.so")),
     ?assertMatch({ok, _}, retest_sh:run("./rebar compile", [])),
+    ?assertMatch(true, filelib:is_regular("compile_commands.json")),
     TestSo1 = filelib:last_modified("priv/test" ++
                                     shared_library_file_extension(os:type())),
     ?assert(TestSo1 > 0),
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/rebar-2.6.1+git20160413.9281b84/rebar.config 
new/rebar-2.6.4+git20160922.576e121/rebar.config
--- old/rebar-2.6.1+git20160413.9281b84/rebar.config    2016-05-09 
22:45:59.000000000 +0200
+++ new/rebar-2.6.4+git20160922.576e121/rebar.config    2016-09-22 
13:01:52.000000000 +0200
@@ -30,7 +30,9 @@
       - (\"diameter_codegen\":\"from_dict\"/\"4\")
       - (\"diameter_dict_util\":\"format_error\"/\"1\")
       - (\"diameter_dict_util\":\"parse\"/\"2\")
-      - (\"erlang\":\"timestamp\"/\"0\"))",
+      - (\"erlang\":\"timestamp\"/\"0\")
+      - (\"rebar_rnd\":\"seed\"/\"1\")
+      - (\"rebar_rnd\":\"uniform\"/\"0\"))",
          []}]}.
 
 {dialyzer,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/rebar-2.6.1+git20160413.9281b84/src/rebar.erl 
new/rebar-2.6.4+git20160922.576e121/src/rebar.erl
--- old/rebar-2.6.1+git20160413.9281b84/src/rebar.erl   2016-05-09 
22:45:59.000000000 +0200
+++ new/rebar-2.6.4+git20160922.576e121/src/rebar.erl   2016-09-22 
13:01:52.000000000 +0200
@@ -220,6 +220,9 @@
         {error, {already_started, _}} -> ok
     end,
 
+    %% Make sure rebar_rnd module is generated, compiled, and loaded
+    {ok, rebar_rnd} = rebar_rand_compat:init("rebar_rnd"),
+
     %% Convert command strings to atoms
     CommandAtoms = [list_to_atom(C) || C <- Commands],
 
@@ -590,7 +593,7 @@
         [FullCommand] ->
             [FullCommand | unabbreviate_command_names(Commands)];
         Candidates ->
-            ?ABORT("Found more than one match for abbreviated command name "
+            ?ABORT("Found more than one match for abbreviated command name"
                    " '~s',~nplease be more specific. Possible candidates:~n"
                    "  ~s~n",
                    [Command, string:join(Candidates, ", ")])
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/rebar-2.6.1+git20160413.9281b84/src/rebar_eunit.erl 
new/rebar-2.6.4+git20160922.576e121/src/rebar_eunit.erl
--- old/rebar-2.6.1+git20160413.9281b84/src/rebar_eunit.erl     2016-05-09 
22:45:59.000000000 +0200
+++ new/rebar-2.6.4+git20160922.576e121/src/rebar_eunit.erl     2016-09-22 
13:01:52.000000000 +0200
@@ -293,9 +293,9 @@
     end.
 
 randomize_suites1(Modules, Seed) ->
-    _ = random:seed(35, Seed, 1337),
+    _ = rebar_rnd:seed({35, Seed, 1337}),
     ?CONSOLE("Randomizing suite order with seed ~b~n", [Seed]),
-    [X||{_,X} <- lists:sort([{random:uniform(), M} || M <- Modules])].
+    [X||{_,X} <- lists:sort([{rebar_rnd:uniform(), M} || M <- Modules])].
 
 %%
 %% == get matching tests ==
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/rebar-2.6.1+git20160413.9281b84/src/rebar_port_compiler.erl 
new/rebar-2.6.4+git20160922.576e121/src/rebar_port_compiler.erl
--- old/rebar-2.6.1+git20160413.9281b84/src/rebar_port_compiler.erl     
2016-05-09 22:45:59.000000000 +0200
+++ new/rebar-2.6.4+git20160922.576e121/src/rebar_port_compiler.erl     
2016-09-22 13:01:52.000000000 +0200
@@ -36,10 +36,11 @@
 -include("rebar.hrl").
 
 -record(spec, {type::'drv' | 'exe',
+               link_lang::'cc' | 'cxx',
                target::file:filename(),
                sources = [] :: [file:filename(), ...],
                objects = [] :: [file:filename(), ...],
-               opts = [] ::list() | []}).
+               opts = [] :: list() | []}).
 
 %% ===================================================================
 %% Public API
@@ -65,13 +66,15 @@
             %% Only relink if necessary, given the Target
             %% and list of new binaries
             lists:foreach(
-              fun(#spec{target=Target, objects=Bins, opts=Opts}) ->
+              fun(#spec{target=Target, objects=Bins, opts=Opts,
+                        link_lang=LinkLang}) ->
                       AllBins = [sets:from_list(Bins),
                                  sets:from_list(NewBins)],
                       Intersection = sets:intersection(AllBins),
                       case needs_link(Target, sets:to_list(Intersection)) of
                           true ->
-                              LinkTemplate = select_link_template(Target),
+                              LinkTemplate = select_link_template(LinkLang,
+                                                                  Target),
                               Env = proplists:get_value(env, Opts, SharedEnv),
                               Cmd = expand_command(LinkTemplate, Env,
                                                    string:join(Bins, " "),
@@ -140,12 +143,14 @@
        "           EXE_CFLAGS  - flags that will be used for compiling~n"
        "           EXE_LDFLAGS - flags that will be used for linking~n"
        "           ERL_EI_LIBDIR - ei library directory~n"
-       "           DRV_CXX_TEMPLATE  - C++ command template~n"
-       "           DRV_CC_TEMPLATE   - C command template~n"
-       "           DRV_LINK_TEMPLATE - Linker command template~n"
-       "           EXE_CXX_TEMPLATE  - C++ command template~n"
-       "           EXE_CC_TEMPLATE   - C command template~n"
-       "           EXE_LINK_TEMPLATE - Linker command template~n"
+       "           DRV_CXX_TEMPLATE      - C++ command template~n"
+       "           DRV_CC_TEMPLATE       - C command template~n"
+       "           DRV_LINK_TEMPLATE     - C Linker command template~n"
+       "           DRV_LINK_CXX_TEMPLATE - C++ Linker command template~n"
+       "           EXE_CXX_TEMPLATE      - C++ command template~n"
+       "           EXE_CC_TEMPLATE       - C command template~n"
+       "           EXE_LINK_TEMPLATE     - C Linker command template~n"
+       "           EXE_LINK_CXX_TEMPLATE - C++ Linker command template~n"
        "~n"
        "           Note that if you wish to extend (vs. replace) these 
variables,~n"
        "           you MUST include a shell-style reference in your 
definition.~n"
@@ -211,29 +216,72 @@
 %%
 
 compile_sources(Config, Specs, SharedEnv) ->
-    lists:foldl(
-      fun(#spec{sources=Sources, type=Type, opts=Opts}, NewBins) ->
-              Env = proplists:get_value(env, Opts, SharedEnv),
-              compile_each(Config, Sources, Type, Env, NewBins)
-      end, [], Specs).
-
-compile_each(_Config, [], _Type, _Env, NewBins) ->
-    lists:reverse(NewBins);
-compile_each(Config, [Source | Rest], Type, Env, NewBins) ->
+    {NewBins, Db} =
+        lists:foldl(
+          fun(#spec{sources=Sources, type=Type, opts=Opts}, Acc) ->
+                  Env = proplists:get_value(env, Opts, SharedEnv),
+                  compile_each(Config, Sources, Type, Env, Acc)
+          end, {[], []}, Specs),
+    %% Rewrite clang compile commands database file only if something
+    %% was compiled.
+    case NewBins of
+        [] ->
+            ok;
+        _ ->
+            {ok, ClangDbFile} = file:open("compile_commands.json", [write]),
+            ok = io:fwrite(ClangDbFile, "[~n", []),
+            lists:foreach(fun(E) -> ok = io:fwrite(ClangDbFile, E, []) end, 
Db),
+            ok = io:fwrite(ClangDbFile, "]~n", []),
+            ok = file:close(ClangDbFile)
+    end,
+    NewBins.
+
+compile_each(_Config, [], _Type, _Env, {NewBins, CDB}) ->
+    {lists:reverse(NewBins), lists:reverse(CDB)};
+compile_each(Config, [Source | Rest], Type, Env, {NewBins, CDB}) ->
     Ext = filename:extension(Source),
     Bin = replace_extension(Source, Ext, ".o"),
+    Template = select_compile_template(Type, compiler(Ext)),
+    Cmd = expand_command(Template, Env, Source, Bin),
+    CDBEnt = cdb_entry(Source, Cmd, Rest),
+    NewCDB = [CDBEnt | CDB],
     case needs_compile(Source, Bin) of
         true ->
-            Template = select_compile_template(Type, compiler(Ext)),
-            Cmd = expand_command(Template, Env, Source, Bin),
             ShOpts = [{env, Env}, return_on_error, {use_stdout, false}],
             exec_compiler(Config, Source, Cmd, ShOpts),
-            compile_each(Config, Rest, Type, Env, [Bin | NewBins]);
+            compile_each(Config, Rest, Type, Env,
+                         {[Bin | NewBins], NewCDB});
         false ->
             ?INFO("Skipping ~s\n", [Source]),
-            compile_each(Config, Rest, Type, Env, NewBins)
+            compile_each(Config, Rest, Type, Env, {NewBins, NewCDB})
     end.
 
+%% Generate a clang compilation db entry for Src and Cmd
+cdb_entry(Src, Cmd, SrcRest) ->
+    %% Omit all variables from cmd, and use that as cmd in
+    %% CDB, because otherwise clang-* will complain about it.
+    CDBCmd = string:join(
+               lists:filter(
+                 fun("$"++_) -> false;
+                    (_)      -> true
+                 end,
+                 string:tokens(Cmd, " ")),
+               " "),
+
+    Cwd = rebar_utils:get_cwd(),
+    %% If there are more source files, make sure we end the CDB entry
+    %% with a comma.
+    Sep = case SrcRest of
+              [] -> "~n";
+              _  -> ",~n"
+          end,
+    %% CDB entry
+    ?FMT("{ \"file\"      : ~p~n"
+         ", \"directory\" : ~p~n"
+         ", \"command\"   : ~p~n"
+         "}~s",
+         [Src, Cwd, CDBCmd, Sep]).
+
 exec_compiler(Config, Source, Cmd, ShOpts) ->
     case rebar_utils:sh(Cmd, ShOpts) of
         {error, {_RC, RawError}} ->
@@ -323,6 +371,7 @@
     Sources = port_sources(rebar_config:get_list(Config, port_sources,
                                                  ["c_src/*.c"])),
     #spec { type = target_type(Target),
+            link_lang = cc,
             target = maybe_switch_extension(os:type(), Target),
             sources = Sources,
             objects = port_objects(Sources) }.
@@ -343,9 +392,18 @@
     get_port_spec(Config, OsType, {Arch, Target, Sources, []});
 get_port_spec(Config, OsType, {_Arch, Target, Sources, Opts}) ->
     SourceFiles = port_sources(Sources),
+    LinkLang =
+        case lists:any(
+               fun(Src) -> compiler(filename:extension(Src)) == "$CXX" end,
+               SourceFiles)
+        of
+            true  -> cxx;
+            false -> cc
+        end,
     ObjectFiles = port_objects(SourceFiles),
     #spec{type=target_type(Target),
           target=maybe_switch_extension(OsType, Target),
+          link_lang=LinkLang,
           sources=SourceFiles,
           objects=ObjectFiles,
           opts=port_opts(Config, Opts)}.
@@ -495,10 +553,9 @@
 
 %%
 %% Given a string, determine if it is expandable
-%% A string is defined as expandable if it contains itself
-%%  (eg. CFLAGS = -m64 $CFLAGS)
+%%
 is_expandable(InStr) ->
-    case re:run(InStr,"\\\$"++InStr,[{capture,none}]) of
+    case re:run(InStr,"\\\$",[{capture,none}]) of
         match -> true;
         nomatch -> false
     end.
@@ -549,10 +606,12 @@
 select_compile_exe_template("$CC")  -> "EXE_CC_TEMPLATE";
 select_compile_exe_template("$CXX") -> "EXE_CXX_TEMPLATE".
 
-select_link_template(Target) ->
-    case target_type(Target) of
-        drv -> "DRV_LINK_TEMPLATE";
-        exe -> "EXE_LINK_TEMPLATE"
+select_link_template(LinkLang, Target) ->
+    case {LinkLang, target_type(Target)} of
+        {cc,  drv} -> "DRV_LINK_TEMPLATE";
+        {cxx, drv} -> "DRV_LINK_CXX_TEMPLATE";
+        {cc,  exe} -> "EXE_LINK_TEMPLATE";
+        {cxx, exe} -> "EXE_LINK_CXX_TEMPLATE"
     end.
 
 target_type(Target) -> target_type1(filename:extension(Target)).
@@ -574,8 +633,8 @@
     Arch = os:getenv("REBAR_TARGET_ARCH"),
     Vsn = os:getenv("REBAR_TARGET_ARCH_VSN"),
     [
-     {"CC", get_tool(Arch, Vsn,"gcc", "cc")},
-     {"CXX", get_tool(Arch, Vsn,"g++", "c++")},
+     {"CC", get_tool(Arch, Vsn, "gcc", "cc")},
+     {"CXX", get_tool(Arch, Vsn, "g++", "c++")},
      {"AR", get_tool(Arch, "ar", "ar")},
      {"AS", get_tool(Arch, "as", "as")},
      {"CPP", get_tool(Arch, Vsn, "cpp", "cpp")},
@@ -592,12 +651,16 @@
       "$CC -c $CFLAGS $DRV_CFLAGS $PORT_IN_FILES -o $PORT_OUT_FILE"},
      {"DRV_LINK_TEMPLATE",
       "$CC $PORT_IN_FILES $LDFLAGS $DRV_LDFLAGS -o $PORT_OUT_FILE"},
+     {"DRV_LINK_CXX_TEMPLATE",
+      "$CXX $PORT_IN_FILES $LDFLAGS $DRV_LDFLAGS -o $PORT_OUT_FILE"},
      {"EXE_CXX_TEMPLATE",
       "$CXX -c $CXXFLAGS $EXE_CFLAGS $PORT_IN_FILES -o $PORT_OUT_FILE"},
      {"EXE_CC_TEMPLATE",
       "$CC -c $CFLAGS $EXE_CFLAGS $PORT_IN_FILES -o $PORT_OUT_FILE"},
      {"EXE_LINK_TEMPLATE",
       "$CC $PORT_IN_FILES $LDFLAGS $EXE_LDFLAGS -o $PORT_OUT_FILE"},
+     {"EXE_LINK_CXX_TEMPLATE",
+      "$CXX $PORT_IN_FILES $LDFLAGS $EXE_LDFLAGS -o $PORT_OUT_FILE"},
      {"DRV_CFLAGS" , "-g -Wall -fPIC -MMD $ERL_CFLAGS"},
      {"DRV_LDFLAGS", "-shared $ERL_LDFLAGS"},
      {"EXE_CFLAGS" , "-g -Wall -fPIC -MMD $ERL_CFLAGS"},
@@ -625,17 +688,17 @@
      %% OS X Leopard flags for 64-bit
      {"darwin9.*-64$", "CFLAGS", "-m64 $CFLAGS"},
      {"darwin9.*-64$", "CXXFLAGS", "-m64 $CXXFLAGS"},
-     {"darwin9.*-64$", "LDFLAGS", "-arch x86_64 $LDFLAGS"},
+     {"darwin9.*-64$", "LDFLAGS", "-arch x86_64 -flat_namespace -undefined 
suppress $LDFLAGS"},
 
      %% OS X Lion onwards flags for 64-bit
      {"darwin1[0-4].*-64$", "CFLAGS", "-m64 $CFLAGS"},
      {"darwin1[0-4].*-64$", "CXXFLAGS", "-m64 $CXXFLAGS"},
-     {"darwin1[0-4].*-64$", "LDFLAGS", "-arch x86_64 $LDFLAGS"},
+     {"darwin1[0-4].*-64$", "LDFLAGS", "-arch x86_64 -flat_namespace 
-undefined suppress $LDFLAGS"},
 
      %% OS X Snow Leopard, Lion, and Mountain Lion flags for 32-bit
      {"darwin1[0-2].*-32", "CFLAGS", "-m32 $CFLAGS"},
      {"darwin1[0-2].*-32", "CXXFLAGS", "-m32 $CXXFLAGS"},
-     {"darwin1[0-2].*-32", "LDFLAGS", "-arch i386 $LDFLAGS"},
+     {"darwin1[0-2].*-32", "LDFLAGS", "-arch i386 -flat_namespace -undefined 
suppress $LDFLAGS"},
 
      %% Windows specific flags
      %% add MS Visual C++ support to rebar on Windows
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/rebar-2.6.1+git20160413.9281b84/src/rebar_qc.erl 
new/rebar-2.6.4+git20160922.576e121/src/rebar_qc.erl
--- old/rebar-2.6.1+git20160413.9281b84/src/rebar_qc.erl        2016-05-09 
22:45:59.000000000 +0200
+++ new/rebar-2.6.4+git20160922.576e121/src/rebar_qc.erl        2016-09-22 
13:01:52.000000000 +0200
@@ -4,7 +4,7 @@
 %%
 %% rebar: Erlang Build Tools
 %%
-%% Copyright (c) 2011-2014 Tuncer Ayaz
+%% Copyright (c) 2011-2016 Tuncer Ayaz
 %%
 %% Permission is hereby granted, free of charge, to any person obtaining a copy
 %% of this software and associated documentation files (the "Software"), to 
deal
@@ -43,16 +43,13 @@
 %% ===================================================================
 
 qc(Config, _AppFile) ->
-    ?CONSOLE("NOTICE: Using experimental 'qc' command~n", []),
     run_qc(Config, qc_opts(Config)).
 
 triq(Config, _AppFile) ->
-    ?CONSOLE("NOTICE: Using experimental 'triq' command~n", []),
     ok = load_qc_mod(triq),
     run_qc(Config, qc_opts(Config), triq).
 
 eqc(Config, _AppFile) ->
-    ?CONSOLE("NOTICE: Using experimental 'eqc' command~n", []),
     ok = load_qc_mod(eqc),
     run_qc(Config, qc_opts(Config), eqc).
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/rebar-2.6.1+git20160413.9281b84/src/rebar_rand_compat.erl 
new/rebar-2.6.4+git20160922.576e121/src/rebar_rand_compat.erl
--- old/rebar-2.6.1+git20160413.9281b84/src/rebar_rand_compat.erl       
1970-01-01 01:00:00.000000000 +0100
+++ new/rebar-2.6.4+git20160922.576e121/src/rebar_rand_compat.erl       
2016-09-22 13:01:52.000000000 +0200
@@ -0,0 +1,178 @@
+%%% -*- erlang-indent-level: 4;indent-tabs-mode: nil -*-
+%%% ex: ts=4 sw=4 et
+%%%
+%%% Copyright (c) 2016 Tuncer Ayaz
+%%%
+%%% Permission to use, copy, modify, and/or distribute this software
+%%% for any purpose with or without fee is hereby granted, provided
+%%% that the above copyright notice and this permission notice appear
+%%% in all copies.
+%%%
+%%% THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
+%%% WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
+%%% WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
+%%% AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR
+%%% CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+%%% LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+%%% NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+%%% CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+-module(rebar_rand_compat).
+
+%% API
+-export([ init/0
+        , init/1
+        ]).
+
+-define(DEFAULT_MODNAME, "rnd").
+
+%%%===================================================================
+%%% API
+%%%===================================================================
+
+%%--------------------------------------------------------------------
+%% @doc
+%% Generate, compile and load rnd module.
+%% @end
+%%--------------------------------------------------------------------
+-spec init() -> {'ok', module()}.
+init() ->
+    init(?DEFAULT_MODNAME).
+
+%%--------------------------------------------------------------------
+%% @doc
+%% Generate, compile and load ModName module.
+%% @end
+%%--------------------------------------------------------------------
+-spec init(string()) -> {'ok', module()}.
+init(ModName) ->
+    %% First, select the right module, then generate the appropriate code as a
+    %% string, and finally compile and load it as ModName.
+    Src = select(ModName),
+    {ok, Mod, Bin, []} = compile(Src),
+    {module, Mod} = code:load_binary(Mod, ModName++".erl", Bin),
+    {ok, Mod}.
+
+%%%===================================================================
+%%% Internal functions
+%%%===================================================================
+
+%% Select right rand module and return wrapper module's source as string
+-spec select(string()) -> string().
+select(ModName) ->
+    case code:which(rand) of
+        non_existing ->
+            src(ModName, fun funs_random/0);
+        _ ->
+            src(ModName, fun funs_rand/0)
+    end.
+
+%% Return module's implementation as a string.
+-spec src(string(), fun(() -> binary())) -> string().
+src(ModName, GenFuns) ->
+    lists:flatten(
+      io_lib:format(
+        <<"
+-module(~s).
+-export([ seed/0
+        , seed/1
+        , uniform/0
+        , uniform/1
+        , uniform_s/1
+        , uniform_s/2
+        ]).
+
+%% Functions
+~s
+">>
+, [ModName, GenFuns()])).
+
+%% random.beam wrapper
+funs_random() ->
+    <<"
+seed()           -> random:seed().
+seed(Exp)        -> random:seed(Exp).
+uniform()        -> random:uniform().
+uniform(N)       -> random:uniform(N).
+uniform_s(St)    -> random:uniform_s(St).
+uniform_s(N, St) -> random:uniform_s(N, St).
+">>.
+
+%% rand.beam wrapper
+funs_rand() ->
+    <<"
+seed()           -> rand:seed(exsplus).
+seed(Exp)        -> rand:seed(exsplus, Exp).
+uniform()        -> rand:uniform().
+uniform(N)       -> rand:uniform(N).
+uniform_s(St)    -> rand:uniform_s(St).
+uniform_s(N, St) -> rand:uniform_s(N, St).
+">>.
+
+compile(String) ->
+    Forms = convert(String ++ eof, []),
+    compile:forms(Forms, [return]).
+
+%% Parse string into forms for compiler.
+convert({done, {eof, _EndLocation}, _LeftOverChars}, Acc)->
+    %% Finished
+    lists:reverse(Acc);
+convert({done, {error, ErrorInfo, _EndLocation}, _LeftOverChars}, _Acc)->
+    ErrorInfo;
+convert({done, {ok, Tokens, _EndLocation}, LeftOverChars}, Acc)->
+    case erl_parse:parse_form(Tokens) of
+        {ok, AbsForm} ->
+            convert(LeftOverChars, [AbsForm|Acc]);
+        {error, AbsForm} ->
+            convert(LeftOverChars, AbsForm)
+    end;
+convert({more, Continuation}, Acc)->
+    convert(erl_scan:tokens(Continuation, [], 1), Acc);
+convert(String, Acc) ->
+    convert(erl_scan:tokens([], String, 1), Acc).
+
+%%%===================================================================
+%%% Tests
+%%%===================================================================
+
+-ifdef(TEST).
+-include_lib("eunit/include/eunit.hrl").
+
+init_test() ->
+    DefMod = list_to_atom(?DEFAULT_MODNAME),
+    ok = unload(DefMod),
+    ?assertMatch(false, code:is_loaded(DefMod)),
+    ?assertMatch({ok, DefMod}, init()),
+    ?assertMatch({file, _}, code:is_loaded(DefMod)),
+    check_api(DefMod),
+    CustomMod = foornd,
+    CustomName = "foornd",
+    ok = unload(CustomMod),
+    ?assertMatch(false, code:is_loaded(CustomMod)),
+    ?assertMatch({ok, CustomMod}, init(CustomName)),
+    ?assertMatch({file, _}, code:is_loaded(CustomMod)),
+    check_api(CustomMod).
+
+unload(Mod) ->
+    case code:is_loaded(Mod) of
+        false ->
+            ok;
+        {file, _} ->
+            code:delete(Mod),
+            code:purge(Mod),
+            ok
+    end.
+
+check_api(Mod) ->
+    Exports = [ {seed, 0}
+              , {seed, 1}
+              , {uniform, 0}
+              , {uniform, 1}
+              , {uniform_s, 1}
+              , {uniform_s, 2}
+              , {module_info, 0}
+              , {module_info, 1}
+              ],
+    ?assertMatch(Exports, Mod:module_info(exports)).
+
+-endif.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/rebar-2.6.1+git20160413.9281b84/src/rebar_utils.erl 
new/rebar-2.6.4+git20160922.576e121/src/rebar_utils.erl
--- old/rebar-2.6.1+git20160413.9281b84/src/rebar_utils.erl     2016-05-09 
22:45:59.000000000 +0200
+++ new/rebar-2.6.4+git20160922.576e121/src/rebar_utils.erl     2016-09-22 
13:01:52.000000000 +0200
@@ -94,6 +94,7 @@
         nomatch ->
             false
     end.
+
 %%
 %% REBAR_TARGET_ARCH, if used, should be set to the "standard"
 %% target string. That is a prefix for binutils tools.


Reply via email to