aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2011-03-18 12:35:53 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2011-03-18 12:35:53 +0200
commitacff75b62b48f9a121d935e1f59ddc465145618c (patch)
tree3a82b256f3f4b75c17a9013d0f158183383105cb
parent35c31a19f90608df19f0c4aa077dcbbe5150d3e4 (diff)
Development build system setup
-rw-r--r--build/bootstrap.make72
-rw-r--r--build/import/cli/LICENSE21
-rw-r--r--build/import/cli/cli-cxx.make49
-rw-r--r--build/import/cli/configuration-rules.make15
-rwxr-xr-xbuild/import/cli/configure55
-rw-r--r--build/import/cli/stub.make30
-rw-r--r--build/import/libodb/LICENSE12
-rw-r--r--build/import/libodb/configuration-rules.make15
-rwxr-xr-xbuild/import/libodb/configure55
-rw-r--r--build/import/libodb/stub.make30
-rw-r--r--makefile36
-rw-r--r--odb/sqlite/details/config.h.in14
-rw-r--r--odb/sqlite/details/config.hxx20
-rw-r--r--odb/sqlite/details/export.hxx41
-rw-r--r--odb/sqlite/details/options.cli48
-rw-r--r--odb/sqlite/forward.hxx37
-rw-r--r--odb/sqlite/makefile124
-rw-r--r--odb/sqlite/version.hxx44
18 files changed, 718 insertions, 0 deletions
diff --git a/build/bootstrap.make b/build/bootstrap.make
new file mode 100644
index 0000000..b5f87a7
--- /dev/null
+++ b/build/bootstrap.make
@@ -0,0 +1,72 @@
+# file : build/bootstrap.make
+# author : Boris Kolpackov <boris@codesynthesis.com>
+# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC
+# license : GNU GPL v2; see accompanying LICENSE file
+
+project_name := libodb-sqlite
+
+# First try to include the bundled bootstrap.make if it exist. If that
+# fails, let make search for the external bootstrap.make.
+#
+build := build-0.3
+
+-include $(dir $(lastword $(MAKEFILE_LIST)))../../$(build)/bootstrap.make
+
+ifeq ($(patsubst %build/bootstrap.make,,$(lastword $(MAKEFILE_LIST))),)
+include $(build)/bootstrap.make
+endif
+
+
+# Aliases
+#
+.PHONY: $(out_base)/ \
+ $(out_base)/.test \
+ $(out_base)/.dist \
+ $(out_base)/.clean
+
+ifdef %interactive%
+
+.PHONY: test dist clean
+
+test: $(out_base)/.test
+dist: $(out_base)/.dist
+clean: $(out_base)/.clean
+
+ifneq ($(filter $(.DEFAULT_GOAL),test dist clean),)
+.DEFAULT_GOAL :=
+endif
+
+endif
+
+# Make sure the distribution prefix is set if the goal is dist.
+#
+ifneq ($(filter $(MAKECMDGOALS),dist),)
+ifeq ($(dist_prefix),)
+$(error dist_prefix is not set)
+endif
+endif
+
+# If we don't have dependency auto-generation then we need to manually
+# make sure that generated files are generated before C++ file are
+# compiler. To do this we make the object files ($2) depend in order-
+# only on generated files ($3).
+#
+ifeq ($(cxx_id),generic)
+
+define include-dep
+$(if $2,$(eval $2: | $3))
+endef
+
+else
+
+define include-dep
+$(call -include,$1)
+endef
+
+endif
+
+# Don't include dependency info for certain targets.
+#
+ifneq ($(filter $(MAKECMDGOALS),clean disfigure dist),)
+include-dep =
+endif
diff --git a/build/import/cli/LICENSE b/build/import/cli/LICENSE
new file mode 100644
index 0000000..3fe3ab2
--- /dev/null
+++ b/build/import/cli/LICENSE
@@ -0,0 +1,21 @@
+Copyright (c) 2009-2011 Code Synthesis Tools CC.
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be included
+in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
diff --git a/build/import/cli/cli-cxx.make b/build/import/cli/cli-cxx.make
new file mode 100644
index 0000000..5d4293e
--- /dev/null
+++ b/build/import/cli/cli-cxx.make
@@ -0,0 +1,49 @@
+# file : build/import/cli/cli-cxx.make
+# author : Boris Kolpackov <boris@codesynthesis.com>
+# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC
+# license : MIT; see accompanying LICENSE file
+
+# Here we are operating in the importing project's space, not in
+# cli's.
+#
+
+# Get the C++ file extensions.
+#
+$(call include,$(bld_root)/cxx/configuration-static.make)
+
+cli_pattern := \
+$(out_base)/%.$(cxx_s_suffix) \
+$(out_base)/%.$(cxx_h_suffix) \
+$(out_base)/%.$(cxx_i_suffix)
+
+$(cli_pattern): cli_options := \
+--hxx-suffix .$(cxx_h_suffix) \
+--ixx-suffix .$(cxx_i_suffix) \
+--cxx-suffix .$(cxx_s_suffix)
+
+.PRECIOUS: $(cli_pattern)
+
+ifeq ($(out_base),$(src_base))
+
+$(cli_pattern): $(src_base)/%.cli
+ $(call message,cli $<,$(cli) $(cli_options) --output-dir $(dir $@) $<)
+
+else
+
+$(cli_pattern): $(src_base)/%.cli | $$(dir $$@).
+ $(call message,cli $<,$(cli) $(cli_options) --output-dir $(dir $@) $<)
+
+$(cli_pattern): $(out_base)/%.cli | $$(dir $$@).
+ $(call message,cli $<,$(cli) $(cli_options) --output-dir $(dir $@) $<)
+endif
+
+.PHONY: $(out_base)/%.cxx.cli.clean
+
+$(out_base)/%.cxx.cli.clean: cxx_s_suffix := $(cxx_s_suffix)
+$(out_base)/%.cxx.cli.clean: cxx_h_suffix := $(cxx_h_suffix)
+$(out_base)/%.cxx.cli.clean: cxx_i_suffix := $(cxx_i_suffix)
+
+$(out_base)/%.cxx.cli.clean:
+ $(call message,rm $$1,rm -f $$1,$(@:.cxx.cli.clean=.$(cxx_s_suffix)))
+ $(call message,rm $$1,rm -f $$1,$(@:.cxx.cli.clean=.$(cxx_h_suffix)))
+ $(call message,rm $$1,rm -f $$1,$(@:.cxx.cli.clean=.$(cxx_i_suffix)))
diff --git a/build/import/cli/configuration-rules.make b/build/import/cli/configuration-rules.make
new file mode 100644
index 0000000..e5a77f2
--- /dev/null
+++ b/build/import/cli/configuration-rules.make
@@ -0,0 +1,15 @@
+# file : build/import/cli/configuration-rules.make
+# author : Boris Kolpackov <boris@codesynthesis.com>
+# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC
+# license : MIT; see accompanying LICENSE file
+
+$(dcf_root)/import/cli/configuration-dynamic.make: | $(dcf_root)/import/cli/.
+ $(call message,,$(scf_root)/import/cli/configure $@)
+
+ifndef %foreign%
+
+$(dcf_root)/.disfigure::
+ $(call message,rm $(dcf_root)/import/cli/configuration-dynamic.make,\
+rm -f $(dcf_root)/import/cli/configuration-dynamic.make)
+
+endif
diff --git a/build/import/cli/configure b/build/import/cli/configure
new file mode 100755
index 0000000..612301c
--- /dev/null
+++ b/build/import/cli/configure
@@ -0,0 +1,55 @@
+#! /usr/bin/env bash
+
+# file : build/import/cli/configure
+# author : Boris Kolpackov <boris@codesynthesis.com>
+# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC
+# license : MIT; see accompanying LICENSE file
+
+
+# $1 - out file
+#
+# bld_root - build root
+# project_name - project name
+#
+
+source $bld_root/dialog.bash
+
+
+$echo
+$echo "Configuring external dependency on 'cli' for '$project_name'."
+$echo
+
+$echo
+$echo "Would you like to configure dependency on the installed "
+$echo "version of 'cli' as opposed to the development build?"
+$echo
+
+installed=`read_y_n y`
+
+path=
+
+if [ "$installed" = "n" ]; then
+
+$echo
+$echo "Please enter the src_root for 'cli'."
+$echo
+
+src_root=`read_path --directory --exist`
+
+$echo
+$echo "Please enter the out_root for 'cli'."
+$eche
+
+out_root=`read_path --directory $src_root`
+
+fi
+
+echo cli_installed := $installed >$1
+
+if [ "$installed" = "n" ]; then
+
+echo src_root := $src_root >>$1
+echo scf_root := \$\(src_root\)/build >>$1
+echo out_root := $out_root >>$1
+
+fi
diff --git a/build/import/cli/stub.make b/build/import/cli/stub.make
new file mode 100644
index 0000000..20cf45a
--- /dev/null
+++ b/build/import/cli/stub.make
@@ -0,0 +1,30 @@
+# file : build/import/cli/stub.make
+# author : Boris Kolpackov <boris@codesynthesis.com>
+# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC
+# license : MIT; see accompanying LICENSE file
+
+$(call include-once,$(scf_root)/import/cli/configuration-rules.make,$(dcf_root))
+
+cli_installed :=
+
+$(call -include,$(dcf_root)/import/cli/configuration-dynamic.make)
+
+ifdef cli_installed
+
+ifeq ($(cli_installed),y)
+
+$(call export,cli: cli,cli-rules: $(scf_root)/import/cli/cli-cxx.make)
+
+else
+
+# Include export stub.
+#
+$(call include,$(scf_root)/export/cli/stub.make)
+
+endif
+
+else
+
+.NOTPARALLEL:
+
+endif
diff --git a/build/import/libodb/LICENSE b/build/import/libodb/LICENSE
new file mode 100644
index 0000000..ed9c55c
--- /dev/null
+++ b/build/import/libodb/LICENSE
@@ -0,0 +1,12 @@
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License version 2 as
+published by the Free Software Foundation.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
diff --git a/build/import/libodb/configuration-rules.make b/build/import/libodb/configuration-rules.make
new file mode 100644
index 0000000..9263bb0
--- /dev/null
+++ b/build/import/libodb/configuration-rules.make
@@ -0,0 +1,15 @@
+# file : build/import/libodb/configuration-rules.make
+# author : Boris Kolpackov <boris@codesynthesis.com>
+# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC
+# license : GNU GPL v2; see accompanying LICENSE file
+
+$(dcf_root)/import/libodb/configuration-dynamic.make: | $(dcf_root)/import/libodb/.
+ $(call message,,$(scf_root)/import/libodb/configure $@)
+
+ifndef %foreign%
+
+$(dcf_root)/.disfigure::
+ $(call message,rm $(dcf_root)/import/libodb/configuration-dynamic.make,\
+rm -f $(dcf_root)/import/libodb/configuration-dynamic.make)
+
+endif
diff --git a/build/import/libodb/configure b/build/import/libodb/configure
new file mode 100755
index 0000000..90e21d4
--- /dev/null
+++ b/build/import/libodb/configure
@@ -0,0 +1,55 @@
+#! /usr/bin/env bash
+
+# file : build/import/libodb/configure
+# author : Boris Kolpackov <boris@codesynthesis.com>
+# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC
+# license : GNU GPL v2; see accompanying LICENSE file
+
+
+# $1 - out file
+#
+# bld_root - build root
+# project_name - project name
+#
+
+source $bld_root/dialog.bash
+
+
+$echo
+$echo "Configuring external dependency on 'libodb' for '$project_name'."
+$echo
+
+$echo
+$echo "Would you like to configure dependency on the installed "
+$echo "version of 'libodb' as opposed to the development build?"
+$echo
+
+installed=`read_y_n y`
+
+path=
+
+if [ "$installed" = "n" ]; then
+
+$echo
+$echo "Please enter the src_root for 'libodb'."
+$echo
+
+src_root=`read_path --directory --exist`
+
+$echo
+$echo "Please enter the out_root for 'libodb'."
+$echo
+
+out_root=`read_path --directory $src_root`
+
+fi
+
+echo libodb_installed := $installed >$1
+
+if [ "$installed" = "n" ]; then
+
+echo src_root := $src_root >>$1
+echo scf_root := \$\(src_root\)/build >>$1
+echo out_root := $out_root >>$1
+
+fi
diff --git a/build/import/libodb/stub.make b/build/import/libodb/stub.make
new file mode 100644
index 0000000..97bb5ff
--- /dev/null
+++ b/build/import/libodb/stub.make
@@ -0,0 +1,30 @@
+# file : build/import/libodb/stub.make
+# author : Boris Kolpackov <boris@codesynthesis.com>
+# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC
+# license : GNU GPL v2; see accompanying LICENSE file
+
+$(call include-once,$(scf_root)/import/libodb/configuration-rules.make,$(dcf_root))
+
+libodb_installed :=
+
+$(call -include,$(dcf_root)/import/libodb/configuration-dynamic.make)
+
+ifdef libodb_installed
+
+ifeq ($(libodb_installed),y)
+
+$(call export,l: -lodb,cpp-options: )
+
+else
+
+# Include export stub.
+#
+$(call include,$(scf_root)/export/libodb/stub.make)
+
+endif
+
+else
+
+.NOTPARALLEL:
+
+endif
diff --git a/makefile b/makefile
new file mode 100644
index 0000000..6112879
--- /dev/null
+++ b/makefile
@@ -0,0 +1,36 @@
+# file : makefile
+# author : Boris Kolpackov <boris@codesynthesis.com>
+# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC
+# license : GNU GPL v2; see accompanying LICENSE file
+
+include $(dir $(lastword $(MAKEFILE_LIST)))build/bootstrap.make
+
+dirs := odb/sqlite
+
+default := $(out_base)/
+dist := $(out_base)/.dist
+clean := $(out_base)/.clean
+
+$(default): $(addprefix $(out_base)/,$(addsuffix /,$(dirs)))
+
+$(dist): export dirs := $(dirs)
+$(dist): export docs := GPLv2 LICENSE README NEWS version
+$(dist): data_dist := INSTALL libodb-sqlite-vc9.sln libodb-sqlite-vc10.sln
+$(dist): exec_dist := bootstrap
+$(dist): export extra_dist := $(data_dist) $(exec_dist)
+$(dist): export version = $(shell cat $(src_root)/version)
+
+$(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(dirs)))
+ $(call dist-data,$(docs) $(data_dist) libodb-sqlite.pc.in)
+ $(call dist-exec,$(exec_dist))
+ $(call dist-dir,m4)
+ $(call meta-automake)
+ $(call meta-autoconf)
+
+$(clean): $(addprefix $(out_base)/,$(addsuffix /.clean,$(dirs)))
+
+$(call include,$(bld_root)/dist.make)
+$(call include,$(bld_root)/meta/automake.make)
+$(call include,$(bld_root)/meta/autoconf.make)
+
+$(foreach d,$(dirs),$(call import,$(src_base)/$d/makefile))
diff --git a/odb/sqlite/details/config.h.in b/odb/sqlite/details/config.h.in
new file mode 100644
index 0000000..ff8c029
--- /dev/null
+++ b/odb/sqlite/details/config.h.in
@@ -0,0 +1,14 @@
+/* file : odb/sqlite/details/config.h.in
+ * author : Boris Kolpackov <boris@codesynthesis.com>
+ * copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC
+ * license : GNU GPL v2; see accompanying LICENSE file
+ */
+
+/* This file is automatically processed by configure. */
+
+#ifndef ODB_SQLITE_DETAILS_CONFIG_H
+#define ODB_SQLITE_DETAILS_CONFIG_H
+
+#undef LIBODB_SQLITE_STATIC_LIB
+
+#endif /* ODB_SQLITE_DETAILS_CONFIG_H */
diff --git a/odb/sqlite/details/config.hxx b/odb/sqlite/details/config.hxx
new file mode 100644
index 0000000..26aeaf3
--- /dev/null
+++ b/odb/sqlite/details/config.hxx
@@ -0,0 +1,20 @@
+// file : odb/sqlite/details/config.hxx
+// author : Boris Kolpackov <boris@codesynthesis.com>
+// copyright : Copyright (c) 2005-2011 Code Synthesis Tools CC
+// license : GNU GPL v2; see accompanying LICENSE file
+
+#ifndef ODB_SQLITE_DETAILS_CONFIG_HXX
+#define ODB_SQLITE_DETAILS_CONFIG_HXX
+
+// no pre
+
+#ifdef _MSC_VER
+#elif defined(ODB_COMPILER)
+# error libodb-sqlite header included in odb-compiled header
+#else
+# include <odb/sqlite/details/config.h>
+#endif
+
+// no post
+
+#endif // ODB_SQLITE_DETAILS_CONFIG_HXX
diff --git a/odb/sqlite/details/export.hxx b/odb/sqlite/details/export.hxx
new file mode 100644
index 0000000..dd17e33
--- /dev/null
+++ b/odb/sqlite/details/export.hxx
@@ -0,0 +1,41 @@
+// file : odb/sqlite/details/export.hxx
+// author : Boris Kolpackov <boris@codesynthesis.com>
+// copyright : Copyright (c) 2005-2011 Code Synthesis Tools CC
+// license : GNU GPL v2; see accompanying LICENSE file
+
+#ifndef ODB_SQLITE_DETAILS_EXPORT_HXX
+#define ODB_SQLITE_DETAILS_EXPORT_HXX
+
+#include <odb/pre.hxx>
+
+#include <odb/sqlite/details/config.hxx>
+
+#ifdef LIBODB_SQLITE_STATIC_LIB
+# define LIBODB_SQLITE_EXPORT
+#else
+# ifdef _WIN32
+# ifdef _MSC_VER
+# ifdef LIBODB_SQLITE_DYNAMIC_LIB
+# define LIBODB_SQLITE_EXPORT __declspec(dllexport)
+# else
+# define LIBODB_SQLITE_EXPORT __declspec(dllimport)
+# endif
+# else
+# ifdef LIBODB_SQLITE_DYNAMIC_LIB
+# ifdef DLL_EXPORT
+# define LIBODB_SQLITE_EXPORT __declspec(dllexport)
+# else
+# define LIBODB_SQLITE_EXPORT
+# endif
+# else
+# define LIBODB_SQLITE_EXPORT __declspec(dllimport)
+# endif
+# endif
+# else
+# define LIBODB_SQLITE_EXPORT
+# endif
+#endif
+
+#include <odb/post.hxx>
+
+#endif // ODB_SQLITE_DETAILS_EXPORT_HXX
diff --git a/odb/sqlite/details/options.cli b/odb/sqlite/details/options.cli
new file mode 100644
index 0000000..a0af101
--- /dev/null
+++ b/odb/sqlite/details/options.cli
@@ -0,0 +1,48 @@
+// file : odb/sqlite/details/options.cli
+// author : Boris Kolpackov <boris@codesynthesis.com>
+// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC
+// license : GNU GPL v2; see accompanying LICENSE file
+
+include <string>;
+
+namespace odb
+{
+ namespace sqlite
+ {
+ namespace details
+ {
+ class options
+ {
+ std::string --database
+ {
+ "<filename>",
+ "SQLite database file name. If the database file is not specified
+ then a private, temporary on-disk database will be created. Use
+ the \cb{:memory:} special name to create a private, temporary
+ in-memory database."
+ };
+
+ bool --database-create
+ {
+ "Create the SQLite database if it does not already exist. By default
+ opening the database fails if it does not already exist."
+ };
+
+ bool --database-readonly
+ {
+ "Open the SQLite database in read-only mode. By default the database
+ is opened for reading and writing if possible, or reading only if
+ the file is write-protected by the operating system."
+ };
+
+ std::string --options-file
+ {
+ "<file>",
+ "Read additional options from <file>. Each option appearing on a
+ separate line optionally followed by space and an option value.
+ Empty lines and lines starting with \cb{#} are ignored."
+ };
+ };
+ }
+ }
+}
diff --git a/odb/sqlite/forward.hxx b/odb/sqlite/forward.hxx
new file mode 100644
index 0000000..d141534
--- /dev/null
+++ b/odb/sqlite/forward.hxx
@@ -0,0 +1,37 @@
+// file : odb/sqlite/forward.hxx
+// author : Boris Kolpackov <boris@codesynthesis.com>
+// copyright : Copyright (c) 2005-2011 Code Synthesis Tools CC
+// license : GNU GPL v2; see accompanying LICENSE file
+
+#ifndef ODB_SQLITE_FORWARD_HXX
+#define ODB_SQLITE_FORWARD_HXX
+
+#include <odb/pre.hxx>
+
+namespace odb
+{
+ namespace sqlite
+ {
+ // @@ Any garbage here?
+ //
+ class database;
+ class connection;
+ class connection_factory;
+ class transaction;
+ class query;
+
+ // Implementation details.
+ //
+ class select_statement;
+
+ template <typename T>
+ class object_statements;
+
+ template <typename T>
+ class container_statements;
+ }
+}
+
+#include <odb/post.hxx>
+
+#endif // ODB_SQLITE_FORWARD_HXX
diff --git a/odb/sqlite/makefile b/odb/sqlite/makefile
new file mode 100644
index 0000000..4a25dee
--- /dev/null
+++ b/odb/sqlite/makefile
@@ -0,0 +1,124 @@
+# file : odb/sqlite/makefile
+# author : Boris Kolpackov <boris@codesynthesis.com>
+# copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC
+# license : GNU GPL v2; see accompanying LICENSE file
+
+include $(dir $(lastword $(MAKEFILE_LIST)))../../build/bootstrap.make
+
+cxx := \
+
+cli_tun := details/options.cli
+cxx_tun := $(cxx)
+cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o) $(cli_tun:.cli=.o))
+cxx_od := $(cxx_obj:.o=.o.d)
+
+odb_sqlite.l := $(out_base)/odb-sqlite.l
+odb_sqlite.l.cpp-options := $(out_base)/odb-sqlite.l.cpp-options
+
+default := $(out_base)/
+dist := $(out_base)/.dist
+clean := $(out_base)/.clean
+
+# Import.
+#
+$(call import,\
+ $(scf_root)/import/cli/stub.make,\
+ cli: cli,cli-rules: cli_rules)
+
+$(call import,\
+ $(scf_root)/import/libodb/stub.make,\
+ l: odb.l,cpp-options: odb.l.cpp-options)
+
+#$(call import,\
+# $(scf_root)/import/libsqlite/stub.make,\
+# l: sqlite.l,cpp-options: sqlite.l.cpp-options)
+
+# Build.
+#
+$(odb_sqlite.l): $(cxx_obj) $(odb.l) $(sqlite.l)
+$(odb_sqlite.l.cpp-options): value := -I$(out_root) -I$(src_root)
+$(odb_sqlite.l.cpp-options): $(odb.l.cpp-options) $(sqlite.l.cpp-options)
+
+$(cxx_obj) $(cxx_od): $(odb_sqlite.l.cpp-options) $(out_base)/details/config.h
+
+genf := $(cli_tun:.cli=.hxx) $(cli_tun:.cli=.ixx) $(cli_tun:.cli=.cxx)
+gen := $(addprefix $(out_base)/,$(genf))
+
+$(gen): $(cli)
+$(gen): cli := $(cli)
+$(gen): cli_options += \
+--long-usage \
+--generate-file-scanner \
+--cli-namespace odb::sqlite::details::cli \
+--guard-prefix LIBODB_SQLITE_DETAILS
+
+$(out_base)/details/config.h:
+ @echo '/* file : odb/sqlite/details/config.h' >$@
+ @echo ' * author : automatically generated' >>$@
+ @echo ' */' >>$@
+ @echo '' >>$@
+ @echo '#ifndef ODB_SQLITE_DETAILS_CONFIG_H' >>$@
+ @echo '#define ODB_SQLITE_DETAILS_CONFIG_H' >>$@
+ @echo '' >>$@
+ @echo '' >>$@
+ @echo '#endif /* ODB_SQLITE_DETAILS_CONFIG_H */' >>$@
+
+$(call include-dep,$(cxx_od),$(cxx_obj),$(gen) $(out_base)/details/config.h)
+
+# Convenience alias for default target.
+#
+$(out_base)/: $(odb_sqlite.l)
+
+# Dist.
+#
+$(dist): sources_dist := $(cxx)
+$(dist): export sources := $(sources_dist) $(cli_tun:.cli=.cxx)
+$(dist): headers_dist = $(subst $(src_base)/,,$(shell find $(src_base) \
+-name '*.hxx' -o -name '*.ixx' -o -name '*.txx'))
+$(dist): gen_headers := $(cli_tun:.cli=.hxx) $(cli_tun:.cli=.ixx)
+$(dist): export headers = $(sort $(headers_dist) $(gen_headers))
+$(dist): gen_dist := $(gen)
+$(dist): data_dist := $(cli_tun) details/config.h.in
+$(dist): export extra_dist := $(data_dist) libodb-sqlite-vc9.vcproj \
+libodb-sqlite-vc10.vcxproj libodb-sqlite-vc10.vcxproj.filters
+$(dist): export interface_version = $(shell sed -e \
+'s/^\([0-9]*\.[0-9]*\).*/\1/' $(src_root)/version)
+
+$(dist): $(gen)
+ $(call dist-data,$(sources_dist) $(headers_dist) $(data_dist))
+ $(call dist-data,$(gen_dist),$(dist_prefix)/odb/sqlite/details)
+ $(call meta-vc9proj,$(src_base)/libodb-sqlite-vc9.vcproj)
+ $(call meta-vc10proj,$(src_base)/libodb-sqlite-vc10.vcxproj)
+ $(call meta-automake)
+
+# Clean.
+#
+$(clean): $(odb_sqlite.l).o.clean \
+ $(odb_sqlite.l.cpp-options).clean \
+ $(addsuffix .cxx.clean,$(cxx_obj)) \
+ $(addsuffix .cxx.clean,$(cxx_od)) \
+ $(addprefix $(out_base)/,$(cli_tun:.cli=.cxx.cli.clean))
+ $(call message,rm $$1,rm -f $$1,$(out_base)/details/config.h)
+
+# Generated .gitignore.
+#
+ifeq ($(out_base),$(src_base))
+$(odb_sqlite.l): | $(out_base)/.gitignore
+
+$(out_base)/.gitignore: files := details/config.h $(genf)
+$(clean): $(out_base)/.gitignore.clean
+
+$(call include,$(bld_root)/git/gitignore.make)
+endif
+
+# How to.
+#
+$(call include,$(bld_root)/dist.make)
+$(call include,$(bld_root)/meta/vc9proj.make)
+$(call include,$(bld_root)/meta/vc10proj.make)
+$(call include,$(bld_root)/meta/automake.make)
+
+$(call include,$(cli_rules))
+$(call include,$(bld_root)/cxx/o-l.make)
+$(call include,$(bld_root)/cxx/cxx-o.make)
+$(call include,$(bld_root)/cxx/cxx-d.make)
diff --git a/odb/sqlite/version.hxx b/odb/sqlite/version.hxx
new file mode 100644
index 0000000..4759d6d
--- /dev/null
+++ b/odb/sqlite/version.hxx
@@ -0,0 +1,44 @@
+// file : odb/sqlite/version.hxx
+// author : Boris Kolpackov <boris@codesynthesis.com>
+// copyright : Copyright (c) 2005-2011 Code Synthesis Tools CC
+// license : GNU GPL v2; see accompanying LICENSE file
+
+#ifndef ODB_SQLITE_VERSION_HXX
+#define ODB_SQLITE_VERSION_HXX
+
+#include <odb/pre.hxx>
+
+#include <odb/version.hxx>
+
+// Version format is AABBCCDD where
+//
+// AA - major version number
+// BB - minor version number
+// CC - bugfix version number
+// DD - alpha / beta (DD + 50) version number
+//
+// When DD is not 00, 1 is subtracted from AABBCC. For example:
+//
+// Version AABBCCDD
+// 2.0.0 02000000
+// 2.1.0 02010000
+// 2.1.1 02010100
+// 2.2.0.a1 02019901
+// 3.0.0.b2 02999952
+//
+
+// Check that we have compatible ODB version.
+//
+#if ODB_VERSION != 10100
+# error incompatible odb interface version detected
+#endif
+
+// libodb-sqlite version: odb interface version plus the bugfix
+// version.
+//
+#define LIBODB_SQLITE_VERSION 1010000
+#define LIBODB_SQLITE_VERSION_STR "1.1.0"
+
+#include <odb/post.hxx>
+
+#endif // ODB_SQLITE_VERSION_HXX