From 3dea3352e4cd414f01ae3d3b2215d6b0f1348d32 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 30 Aug 2016 09:30:24 +0200 Subject: Remove backwards-compatibility kludges --- build/root.build | 9 +-------- build2/bin/init.cxx | 3 --- build2/buildfile | 16 +++------------- build2/cc/link.cxx | 3 --- build2/cli/init.cxx | 23 +++++++++-------------- build2/context.cxx | 4 ---- build2/dist/init.cxx | 15 +++++---------- build2/install/init.cxx | 2 +- 8 files changed, 19 insertions(+), 56 deletions(-) diff --git a/build/root.build b/build/root.build index 0851534..fd751bc 100644 --- a/build/root.build +++ b/build/root.build @@ -15,12 +15,5 @@ cxx.poptions =+ -I$out_root -I$src_root # All exe{} in tests/ are, well, tests. Don't install them. # -tests/: test.exe = true # @@ BC - -#tests/exe{*}: test = true # @@ BC -tests/: -{ - exe{*}: test = true -} - +tests/exe{*}: test = true tests/: install = false diff --git a/build2/bin/init.cxx b/build2/bin/init.cxx index 6a417e7..5a13a87 100644 --- a/build2/bin/init.cxx +++ b/build2/bin/init.cxx @@ -497,9 +497,6 @@ namespace build2 const path& ar (cast (ap.first)); const path* ranlib (cast_null (rp.first)); - if (ranlib != nullptr && ranlib->empty ()) // @@ BC LT [null]. - ranlib = nullptr; - ar_info ari ( guess_ar (ar, ranlib, fb ? dir_path (*pat) : dir_path ())); diff --git a/build2/buildfile b/build2/buildfile index f0b50cf..5fc3a89 100644 --- a/build2/buildfile +++ b/build2/buildfile @@ -79,27 +79,17 @@ pkgconfig/{hxx cxx}{ init } \ # Pass our compiler target to be used as build2 host. # -# obj{context}: cxx.poptions += -DBUILD2_HOST_TRIPLET=\"$cxx.target\" -if ($__build2_greater_than_0_2_0_hack__ == "true") -{ - var=cxx.target -} -else -{ - var=cxx.host -} - -obj{b context}: cxx.poptions += -DBUILD2_HOST_TRIPLET='"'$($var)'"' +obj{b context}: cxx.poptions += -DBUILD2_HOST_TRIPLET=\"$cxx.target\" # Load the cli module but only if it's available. This way a distribution # that includes pre-generated files can be built without installing cli. # This is also the reason why above we explicitly spelled out individual # source files instead of using the cli.cxx{} group (it won't be there -# unless the module is loaded). +# unless the module is configured). # using? cli -if! $cli.loaded +if! $cli.configured { define cli: file cli{*}: extension = cli diff --git a/build2/cc/link.cxx b/build2/cc/link.cxx index c363a10..72b4876 100644 --- a/build2/cc/link.cxx +++ b/build2/cc/link.cxx @@ -1014,9 +1014,6 @@ namespace build2 { ranlib = rs["bin.ranlib.path"]; - if (ranlib && ranlib->empty ()) // @@ BC LT [null]. - ranlib = lookup (); - const char* rl ( ranlib ? cast (rs["bin.ranlib.checksum"]).c_str () diff --git a/build2/cli/init.cxx b/build2/cli/init.cxx index f2a3e8c..b7a8434 100644 --- a/build2/cli/init.cxx +++ b/build2/cli/init.cxx @@ -251,20 +251,6 @@ namespace build2 if (!cast_false (bs["cxx.loaded"])) fail (loc) << "cxx module must be loaded before cli"; - // Register target types. - // - // Note that we do it even if the module is unconfigured. Failed that, - // writing a buildfile will be pretty hard (actually, a buildfile still - // needs to be prepared that the module itself won't be found and loaded - // by defining fallback target types). This will be a BC change. - // - { - auto& t (bs.target_types); - - t.insert (); - t.insert (); - } - // Load cli.config. // if (!cast_false (bs["cli.config.loaded"])) @@ -281,6 +267,15 @@ namespace build2 return false; } + // Register target types. + // + { + auto& t (bs.target_types); + + t.insert (); + t.insert (); + } + // Register our rules. // { diff --git a/build2/context.cxx b/build2/context.cxx index 0e05926..a3678dd 100644 --- a/build2/context.cxx +++ b/build2/context.cxx @@ -241,10 +241,6 @@ namespace build2 gs.assign ("build.work") = work; gs.assign ("build.home") = home; - // @@ BC - // - gs.assign ("__build2_greater_than_0_2_0_hack__") = true; - // Enter the version. // { diff --git a/build2/dist/init.cxx b/build2/dist/init.cxx index 637a232..338f6c8 100644 --- a/build2/dist/init.cxx +++ b/build2/dist/init.cxx @@ -104,9 +104,7 @@ namespace build2 if (s) { - const value& cv (config::optional (r, "config.dist.root")); - - if (cv && !cv.empty ()) // @@ BC LT [null] + if (const value& cv = config::optional (r, "config.dist.root")) v = cast (cv); // Strip abs_dir_path. } } @@ -118,10 +116,9 @@ namespace build2 if (s) { - const value& cv ( - config::required (r, "config.dist.cmd", path ("install")).first); - - if (cv && !cv.empty ()) // @@ BC LT [null] + if (const value& cv = config::required (r, + "config.dist.cmd", + path ("install")).first) v = cv; } } @@ -133,9 +130,7 @@ namespace build2 if (s) { - const value& cv (config::optional (r, "config.dist.archives")); - - if (cv && !cv.empty ()) // @@ BC LT [null] + if (const value& cv = config::optional (r, "config.dist.archives")) v = cv; } } diff --git a/build2/install/init.cxx b/build2/install/init.cxx index e301f08..bfe3c7c 100644 --- a/build2/install/init.cxx +++ b/build2/install/init.cxx @@ -80,7 +80,7 @@ namespace build2 if (spec) { - if (cv != nullptr && *cv && !cv->empty ()) // @@ BC LT [null] + if (cv != nullptr && *cv) v = cast (*cv); // Strip CT to T. } else -- cgit v1.1