aboutsummaryrefslogtreecommitdiff
path: root/libcommon
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2012-02-24 09:58:48 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2012-02-24 09:58:48 +0200
commit50b4de07844ca2a5781d7845115d7bd9e7c8f003 (patch)
treee433a7f4977729d1f6481d33729787a830ef959e /libcommon
parent0306a05023c3857bc0ee7a3bf8355a5665f78d11 (diff)
C++11 support (initial infrastructure)
Diffstat (limited to 'libcommon')
-rw-r--r--libcommon/common/config-vc.h6
-rw-r--r--libcommon/common/config.h.in1
-rw-r--r--libcommon/common/makefile11
3 files changed, 17 insertions, 1 deletions
diff --git a/libcommon/common/config-vc.h b/libcommon/common/config-vc.h
index 3c150cc..7031e35 100644
--- a/libcommon/common/config-vc.h
+++ b/libcommon/common/config-vc.h
@@ -10,4 +10,10 @@
#define HAVE_TR1_MEMORY
+/* VC++10 has C++11 always enabled.
+ */
+#if _MSC_VER >= 1600
+# define HAVE_CXX11
+#endif
+
#endif /* LIBCOMMON_COMMON_CONFIG_VC_H */
diff --git a/libcommon/common/config.h.in b/libcommon/common/config.h.in
index 4bce49a..ed600ac 100644
--- a/libcommon/common/config.h.in
+++ b/libcommon/common/config.h.in
@@ -14,6 +14,7 @@
#undef DATABASE_ORACLE
#undef DATABASE_MSSQL
#undef HAVE_TR1_MEMORY
+#undef HAVE_CXX11
#undef LIBCOMMON_STATIC_LIB
#endif /* LIBCOMMON_COMMON_CONFIG_H */
diff --git a/libcommon/common/makefile b/libcommon/common/makefile
index 63aaea9..0742caf 100644
--- a/libcommon/common/makefile
+++ b/libcommon/common/makefile
@@ -40,7 +40,11 @@ $(cxx_obj) $(cxx_od): $(common.l.cpp-options) $(out_base)/config.h
$(common.l.cpp-options): value := -I$(out_root)/libcommon -I$(src_root)/libcommon
$(common.l.cpp-options): $(odb_db.l.cpp-options) $(odb.l.cpp-options)
-$(out_base)/config.h: $(dcf_root)/configuration-dynamic.make | $(out_base)/.
+$(call include,$(bld_root)/cxx/standard.make) # cxx_standard
+
+ifdef db_id
+ifdef cxx_standard
+$(out_base)/config.h: | $(out_base)/.
@echo '/* file : libcommon/common/config.h' >$@
@echo ' * note : automatically generated' >>$@
@echo ' */' >>$@
@@ -59,9 +63,14 @@ else ifeq ($(db_id),oracle)
else ifeq ($(db_id),mssql)
@echo '#define DATABASE_MSSQL 1' >>$@
endif
+ifeq ($(cxx_standard),c++11)
+ @echo '#define HAVE_CXX11 1' >>$@
+endif
@echo '#define HAVE_TR1_MEMORY 1' >>$@
@echo '' >>$@
@echo '#endif /* LIBCOMMON_COMMON_CONFIG_H */' >>$@
+endif
+endif
$(call include-dep,$(cxx_od),$(cxx_obj),$(out_base)/config.h)