From 4264df570c04a85ef4c36fdd0ff197cfe3bb557c Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Thu, 13 Feb 2020 11:28:21 +0300 Subject: Use copyright extracted from LICENSE file for printing utility version --- odb/buildfile | 8 ++++++++ odb/odb.cxx | 7 +++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/odb/buildfile b/odb/buildfile index e879349..8c8d458 100644 --- a/odb/buildfile +++ b/odb/buildfile @@ -87,6 +87,14 @@ libus{odb}: {hxx ixx txx cxx}{** -odb -options} {hxx ixx cxx}{options} $libs cxx.poptions += "-I$plugin_dir/include" "-DODB_GXX_NAME=\"$gxx_name\"" cxx.poptions += -DODB_BUILD2 # @@ TMP while supporting other build systems. +# Pass the copyright notice extracted from the LICENSE file. +# +copyright = $process.run_regex(cat $src_root/LICENSE, \ + 'Copyright \(c\) (.+)\.', \ + '\1') + +obj{odb}: cxx.poptions += -DODB_COPYRIGHT=\"$copyright\" + # Generated options parser. # # @@ TMP: currently generated code is committed to allow building from git. diff --git a/odb/odb.cxx b/odb/odb.cxx index db81a3e..5381668 100644 --- a/odb/odb.cxx +++ b/odb/odb.cxx @@ -597,8 +597,11 @@ main (int argc, char* argv[]) if (ops.version ()) { cout << "ODB object-relational mapping (ORM) compiler for C++ " - ODB_COMPILER_VERSION_STR << endl - << "Copyright (c) 2009-2019 Code Synthesis Tools CC" << endl; + ODB_COMPILER_VERSION_STR << endl; + +#ifdef ODB_BUILD2 + cout << "Copyright (c) " << ODB_COPYRIGHT << "." << endl; +#endif cout << "This is free software; see the source for copying " << "conditions. There is NO\nwarranty; not even for " -- cgit v1.1