summaryrefslogtreecommitdiff
path: root/odb
diff options
context:
space:
mode:
Diffstat (limited to 'odb')
-rw-r--r--odb/manifest2
-rw-r--r--odb/odb/buildfile14
-rw-r--r--odb/odb/generator.cxx4
-rw-r--r--odb/odb/odb.cxx22
-rw-r--r--odb/odb/version.hxx.in4
5 files changed, 38 insertions, 8 deletions
diff --git a/odb/manifest b/odb/manifest
index 2ef8b08..3118581 100644
--- a/odb/manifest
+++ b/odb/manifest
@@ -12,7 +12,7 @@ doc-url: https://www.codesynthesis.com/products/odb/doc/manual.xhtml
src-url: https://git.codesynthesis.com/cgit/odb/odb/
email: odb-users@codesynthesis.com
build-warning-email: odb-builds@codesynthesis.com
-builds: all
+builds: all relocatable
builds: -( +windows -gcc ) ; Requires MinGW GCC.
builds: &gcc ; Requires GCC with plugin support enabled.
builds: &gcc-5+ ; Requires GCC 5 or later.
diff --git a/odb/odb/buildfile b/odb/odb/buildfile
index 96eb95f..21b98ed 100644
--- a/odb/odb/buildfile
+++ b/odb/odb/buildfile
@@ -30,6 +30,8 @@ if ($cxx.target.class != 'windows')
#
# NOTE: see ODB_GCC_PLUGIN_DIR when adding this support.
#
+# NOTE: also think about relocatable installation.
+#
plugin{*}: install = bin/
import libs = libcutl%lib{cutl}
@@ -43,11 +45,19 @@ import libs += libstudxml%lib{studxml}
# We, however, don't want to install via the driver since the same driver
# build could be used with multiple plugin builds (e.g., for different GCC
# versions, which is something distribution packagers sometimes want to do).
-# @@ For this we will have to wait for operation-specific values support.
#
exe{odb}: cxx{odb}
exe{odb}: libus{odb}: bin.whole = false
-exe{odb}: plugin{odb}: include = adhoc
+exe{odb}: plugin{odb}:
+{
+ include = adhoc
+
+ # @@ This work but triggers "incompatible libs{cutl} build". Feels like to
+ # solve this we will also need to say update_for_install=false which
+ # we currently cant.
+ #
+ #install = false
+}
# Target metadata, see also --build2-metadata in odb.cxx.
#
diff --git a/odb/odb/generator.cxx b/odb/odb/generator.cxx
index 6348234..f0b92ab 100644
--- a/odb/odb/generator.cxx
+++ b/odb/odb/generator.cxx
@@ -519,8 +519,12 @@ generate (options const& ops,
//
hxx << "#include <odb/version.hxx>" << endl
<< endl
+#if 1
+ << "#if ODB_VERSION != " << ODB_VERSION << "UL" << endl
+#else
<< "#if LIBODB_VERSION_FULL != " << ODB_COMPILER_VERSION << "ULL || \\" << endl
<< " LIBODB_SNAPSHOT != " << ODB_COMPILER_SNAPSHOT << "ULL" << endl
+#endif
<< "#error ODB runtime version mismatch" << endl
<< "#endif" << endl
<< endl;
diff --git a/odb/odb/odb.cxx b/odb/odb/odb.cxx
index 2f2a75d..41063d5 100644
--- a/odb/odb/odb.cxx
+++ b/odb/odb/odb.cxx
@@ -185,6 +185,9 @@ main (int argc, char* argv[])
// Also modify LD_LIBRARY_PATH to include the lib path.
//
+ // @@ Hm, I wonder why we are doing this? (One some platforms, like
+ // Fedora, the directory could be called something else, like lib64).
+ //
#ifndef _WIN32
{
#ifdef __APPLE__
@@ -546,12 +549,12 @@ main (int argc, char* argv[])
//
// To allow executing the ODB compiler in-place we add the odb.exe.dlls/
// directory to PATH. It is a bit of hack but then DLL assemblies for
- // DLLs is whole new level of insanity that we are unlikely to ever
+ // DLLs is a whole new level of insanity that we are unlikely to ever
// touch.
//
// And it turns out we have the same problem in the installed case: if
// the installation directory is not in PATH, then GCC won't find the
- // DLLs the plugin needs. So we handle both here.
+ // DLLs the plugin needs. So we handle both cases here.
//
{
path d (plugin.directory ());
@@ -955,10 +958,19 @@ main (int argc, char* argv[])
// version is a pre-release but having it always won't hurt (it
// will be 0 for final versions).
//
+ // After some experience with requiring the exact version match we
+ // found it just too tedious and went back to only comparing the
+ // interface version (we could support both with an option; see
+ // also similar code in generator.cxx).
+ //
os << "#include <odb/version.hxx>" << endl
<< endl
+#if 1
+ << "#if ODB_VERSION != " << ODB_VERSION << "UL" << endl
+#else
<< "#if LIBODB_VERSION_FULL != " << ODB_COMPILER_VERSION << "ULL"
" || LIBODB_SNAPSHOT != " << ODB_COMPILER_SNAPSHOT << "ULL" << endl
+#endif
<< "# error incompatible ODB compiler and runtime " <<
"versions" << endl
<< "#endif" << endl
@@ -1607,8 +1619,8 @@ plugin_path (path const& drv,
char const plugin_ext[] = ".dll";
// While GCC 8 switched to using .dylib as the plugin extension, there is a
-// bug in the extension stripping code. So for now we use the .so extension
-// everywhere (see also buildfile if changing this).
+// bug (86358) in the extension stripping code. So for now we use the .so
+// extension everywhere (see also buildfile if changing this).
//
//#elif defined(__APPLE__)
// char const plugin_ext[] = ".dylib";
@@ -1629,7 +1641,7 @@ plugin_path (path const& drv,
if (dp.empty ())
{
- cerr << drv << ": error: unable to resolve ODB driver path" << endl;
+ cerr << drv << ": error: unable to resolve ODB compiler driver path" << endl;
return path ();
}
diff --git a/odb/odb/version.hxx.in b/odb/odb/version.hxx.in
index a131c03..2bf2ae7 100644
--- a/odb/odb/version.hxx.in
+++ b/odb/odb/version.hxx.in
@@ -47,4 +47,8 @@
//
#define ODB_COMPILER_VERSION_OLD 2049976
+// ODB interface version: minor, major, and alpha/beta versions.
+//
+#define ODB_VERSION 20476
+
#endif // ODB_COMPILER_VERSION