diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2011-11-15 17:40:25 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2011-11-15 17:40:25 +0200 |
commit | cd63dba445d476317e9a25c9d791a7078a0395c8 (patch) | |
tree | 8d921f73a678613e43ebefb8b33fcbbb977cc0d2 /odb/makefile | |
parent | 982db72f1ec9a8e58c59036a388726bb730f44f4 (diff) |
Add support for selecting threading implementation
Diffstat (limited to 'odb/makefile')
-rw-r--r-- | odb/makefile | 31 |
1 files changed, 29 insertions, 2 deletions
diff --git a/odb/makefile b/odb/makefile index 54499a0..6c243e8 100644 --- a/odb/makefile +++ b/odb/makefile @@ -44,7 +44,22 @@ details/win32/exceptions.cxx win32_dll_cxx := details/win32/dll.cxx -cxx_tun := $(cxx) $(posix_cxx) +cxx_tun := $(cxx) + +ifeq ($(libodb_threads),posix) +cxx_tun += $(posix_cxx) +endif + +ifeq ($(libodb_threads),win32) +cxx_tun += $(win32_cxx) + +$(call include,$(bld_root)/ld/configuration-lib.make) # ld_lib_type + +ifeq ($(ld_lib_type),shared) +cxx_tun += $(win32_dll_cxx) +endif +endif + cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) @@ -58,7 +73,11 @@ clean := $(out_base)/.clean # Build. # -$(odb.l): $(cxx_obj) -lpthread +$(odb.l): $(cxx_obj) + +ifeq ($(libodb_threads),posix) +$(odb.l): -lpthread +endif $(cxx_obj) $(cxx_od): $(odb.l.cpp-options) $(out_base)/details/config.h $(odb.l.cpp-options): value := -I$(out_root) -I$(src_root) @@ -71,7 +90,15 @@ $(out_base)/details/config.h: | $(out_base)/details/. @echo '#ifndef ODB_DETAILS_CONFIG_H' >>$@ @echo '#define ODB_DETAILS_CONFIG_H' >>$@ @echo '' >>$@ +ifeq ($(libodb_threads),posix) @echo '#define ODB_THREADS_POSIX 1' >>$@ +endif +ifeq ($(libodb_threads),win32) + @echo '#define ODB_THREADS_WIN32 1' >>$@ +endif +ifeq ($(libodb_threads),none) + @echo '#define ODB_THREADS_NONE 1' >>$@ +endif @echo '' >>$@ @echo '#endif /* ODB_DETAILS_CONFIG_H */' >>$@ |