From 3fd22b7b86ebad8fbd4b66da3d63e6d9c1ca829c Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 13 Dec 2010 11:38:49 +0200 Subject: Detect TR1 availability Also use the wrapper header from libodb. --- common/inverse/makefile | 3 +-- common/inverse/test.hxx | 7 +++++- common/inverse/tr1-memory.hxx | 41 --------------------------------- common/lazy-ptr/test.hxx | 7 +++--- common/lazy-ptr/tr1-memory.hxx | 41 --------------------------------- common/relationship/makefile | 3 +-- common/relationship/test.hxx | 7 +++++- common/relationship/tr1-memory.hxx | 41 --------------------------------- common/template/Makefile.am | 3 ++- common/template/template-vc10.vcxproj | 12 +++++----- common/template/template-vc9.vcproj | 10 ++++---- configure.ac | 4 ++++ libcommon/common/common.cxx | 4 +--- libcommon/common/config-vc.h | 14 +++++++++++ libcommon/common/config.h.in | 1 + libcommon/common/config.hxx | 15 ++++++++++++ libcommon/common/export.hxx | 4 +--- libcommon/common/libcommon-vc10.vcxproj | 10 ++++---- libcommon/common/libcommon-vc9.vcproj | 8 +++---- libcommon/common/makefile | 8 ++++--- m4/tr1-memory.m4 | 40 ++++++++++++++++++++++++++++++++ mysql/template/Makefile.am | 3 ++- mysql/template/template-vc10.vcxproj | 12 +++++----- mysql/template/template-vc9.vcproj | 10 ++++---- tracer/template/Makefile.am | 4 +++- tracer/template/template-vc10.vcxproj | 16 ++++++++----- tracer/template/template-vc9.vcproj | 14 +++++++---- 27 files changed, 156 insertions(+), 186 deletions(-) delete mode 100644 common/inverse/tr1-memory.hxx delete mode 100644 common/lazy-ptr/tr1-memory.hxx delete mode 100644 common/relationship/tr1-memory.hxx create mode 100644 libcommon/common/config-vc.h create mode 100644 libcommon/common/config.hxx create mode 100644 m4/tr1-memory.m4 diff --git a/common/inverse/makefile b/common/inverse/makefile index b7480fc..05871d1 100644 --- a/common/inverse/makefile +++ b/common/inverse/makefile @@ -53,13 +53,12 @@ name := $(notdir $(src_base)) $(dist): db_id := @database@ $(dist): sources := $(cxx_tun) $(dist): headers := $(odb_hdr) -$(dist): export extra_headers := tr1-memory.hxx $(dist): data_dist := test.std $(dist): export name := $(name) $(dist): export extra_dist := $(data_dist) $(call vc9projs,$(name)) \ $(call vc10projs,$(name)) $(dist): - $(call dist-data,$(sources) $(headers) $(extra_headers) $(data_dist)) + $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) $(call meta-vc9projs,../template/template,$(name)) $(call meta-vc10projs,../template/template,$(name)) diff --git a/common/inverse/test.hxx b/common/inverse/test.hxx index e57cb78..7dcb17e 100644 --- a/common/inverse/test.hxx +++ b/common/inverse/test.hxx @@ -6,14 +6,19 @@ #ifndef TEST_HXX #define TEST_HXX +#include // HAVE_TR1_MEMORY + #include #include #include #include -#include "tr1-memory.hxx" #include +#ifdef HAVE_TR1_MEMORY +# include +#endif + struct obj1; struct obj2; struct obj3; diff --git a/common/inverse/tr1-memory.hxx b/common/inverse/tr1-memory.hxx deleted file mode 100644 index 44d369a..0000000 --- a/common/inverse/tr1-memory.hxx +++ /dev/null @@ -1,41 +0,0 @@ -// file : common/inverse/tr1-memory.hxx -// author : Boris Kolpackov -// copyright : not copyrighted - public domain - -#ifndef TR1_MEMORY_HXX -#define TR1_MEMORY_HXX - -//@@ tmp -#define HAVE_TR1_MEMORY - -// -// Try to include TR1 in a compiler-specific manner. Fall-back -// on the Boost TR1 implementation if the compiler does not support TR1. -// - -#include // __GLIBCXX__, _HAS_TR1 - -// GNU C++ or Intel C++ using libstd++. -// -#if defined (__GNUC__) && __GNUC__ >= 4 && defined (__GLIBCXX__) -# include -// -// IBM XL C++. -// -#elif defined (__xlC__) && __xlC__ >= 0x0900 -# define __IBMCPP_TR1__ -# include -// -// VC++ or Intel C++ using VC++ standard library. -// -#elif defined (_MSC_VER) && \ - (_MSC_VER == 1500 && defined (_HAS_TR1) || _MSC_VER > 1500) -# include -// -// Boost fall-back. -// -#else -# include -#endif - -#endif // TR1_MEMORY_HXX diff --git a/common/lazy-ptr/test.hxx b/common/lazy-ptr/test.hxx index 8b75c46..9c671c1 100644 --- a/common/lazy-ptr/test.hxx +++ b/common/lazy-ptr/test.hxx @@ -6,17 +6,18 @@ #ifndef TEST_HXX #define TEST_HXX +#include // HAVE_TR1_MEMORY + #include #include #include -#include "tr1-memory.hxx" - #include #include #ifdef HAVE_TR1_MEMORY -#include +# include +# include #endif // Raw pointer. diff --git a/common/lazy-ptr/tr1-memory.hxx b/common/lazy-ptr/tr1-memory.hxx deleted file mode 100644 index 8965861..0000000 --- a/common/lazy-ptr/tr1-memory.hxx +++ /dev/null @@ -1,41 +0,0 @@ -// file : common/lazy-ptr/tr1-memory.hxx -// author : Boris Kolpackov -// copyright : not copyrighted - public domain - -#ifndef TR1_MEMORY_HXX -#define TR1_MEMORY_HXX - -//@@ tmp -#define HAVE_TR1_MEMORY - -// -// Try to include TR1 in a compiler-specific manner. Fall-back -// on the Boost TR1 implementation if the compiler does not support TR1. -// - -#include // __GLIBCXX__, _HAS_TR1 - -// GNU C++ or Intel C++ using libstd++. -// -#if defined (__GNUC__) && __GNUC__ >= 4 && defined (__GLIBCXX__) -# include -// -// IBM XL C++. -// -#elif defined (__xlC__) && __xlC__ >= 0x0900 -# define __IBMCPP_TR1__ -# include -// -// VC++ or Intel C++ using VC++ standard library. -// -#elif defined (_MSC_VER) && \ - (_MSC_VER == 1500 && defined (_HAS_TR1) || _MSC_VER > 1500) -# include -// -// Boost fall-back. -// -#else -# include -#endif - -#endif // TR1_MEMORY_HXX diff --git a/common/relationship/makefile b/common/relationship/makefile index 7ed60cf..36c3c48 100644 --- a/common/relationship/makefile +++ b/common/relationship/makefile @@ -53,13 +53,12 @@ name := $(notdir $(src_base)) $(dist): db_id := @database@ $(dist): sources := $(cxx_tun) $(dist): headers := $(odb_hdr) -$(dist): export extra_headers := tr1-memory.hxx $(dist): data_dist := test.std $(dist): export name := $(name) $(dist): export extra_dist := $(data_dist) $(call vc9projs,$(name)) \ $(call vc10projs,$(name)) $(dist): - $(call dist-data,$(sources) $(headers) $(extra_headers) $(data_dist)) + $(call dist-data,$(sources) $(headers) $(data_dist)) $(call meta-automake,../template/Makefile.am) $(call meta-vc9projs,../template/template,$(name)) $(call meta-vc10projs,../template/template,$(name)) diff --git a/common/relationship/test.hxx b/common/relationship/test.hxx index cafdc99..486c417 100644 --- a/common/relationship/test.hxx +++ b/common/relationship/test.hxx @@ -6,15 +6,20 @@ #ifndef TEST_HXX #define TEST_HXX +#include // HAVE_TR1_MEMORY + #include #include #include #include #include -#include "tr1-memory.hxx" #include +#ifdef HAVE_TR1_MEMORY +# include +#endif + // Raw pointer. // #pragma db object pointer(obj1*) diff --git a/common/relationship/tr1-memory.hxx b/common/relationship/tr1-memory.hxx deleted file mode 100644 index a4ce28a..0000000 --- a/common/relationship/tr1-memory.hxx +++ /dev/null @@ -1,41 +0,0 @@ -// file : common/relationship/tr1-memory.hxx -// author : Boris Kolpackov -// copyright : not copyrighted - public domain - -#ifndef TR1_MEMORY_HXX -#define TR1_MEMORY_HXX - -//@@ tmp -#define HAVE_TR1_MEMORY - -// -// Try to include TR1 in a compiler-specific manner. Fall-back -// on the Boost TR1 implementation if the compiler does not support TR1. -// - -#include // __GLIBCXX__, _HAS_TR1 - -// GNU C++ or Intel C++ using libstd++. -// -#if defined (__GNUC__) && __GNUC__ >= 4 && defined (__GLIBCXX__) -# include -// -// IBM XL C++. -// -#elif defined (__xlC__) && __xlC__ >= 0x0900 -# define __IBMCPP_TR1__ -# include -// -// VC++ or Intel C++ using VC++ standard library. -// -#elif defined (_MSC_VER) && \ - (_MSC_VER == 1500 && defined (_HAS_TR1) || _MSC_VER > 1500) -# include -// -// Boost fall-back. -// -#else -# include -#endif - -#endif // TR1_MEMORY_HXX diff --git a/common/template/Makefile.am b/common/template/Makefile.am index 7338a85..a51fddf 100644 --- a/common/template/Makefile.am +++ b/common/template/Makefile.am @@ -22,6 +22,7 @@ CLEANFILES = test-odb.hxx test-odb.ixx test-odb.cxx ODB = @ODB@ ODBFLAGS = @ODBFLAGS@ +ODBCPPFLAGS = @ODBCPPFLAGS@ test-odb.hxx: test.hxx - $(ODB) $(ODBCPPFLAGS) $(CPPFLAGS) $(ODBFLAGS) __value__(odb_options) $< + $(ODB) $(AM_CPPFLAGS) $(ODBCPPFLAGS) $(CPPFLAGS) $(ODBFLAGS) __value__(odb_options) $< diff --git a/common/template/template-vc10.vcxproj b/common/template/template-vc10.vcxproj index e2950f9..e49d337 100644 --- a/common/template/template-vc10.vcxproj +++ b/common/template/template-vc10.vcxproj @@ -1,4 +1,4 @@ - + @@ -88,7 +88,7 @@ Level3 Disabled - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) ..\..\libcommon 4068;4355;4800;4290;%(DisableSpecificWarnings) @@ -104,7 +104,7 @@ Level3 Disabled - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) ..\..\libcommon 4068;4355;4800;4290;%(DisableSpecificWarnings) @@ -122,7 +122,7 @@ MaxSpeed true true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + WIN32;NDEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) ..\..\libcommon 4068;4355;4800;4290;%(DisableSpecificWarnings) @@ -142,7 +142,7 @@ MaxSpeed true true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + WIN32;NDEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) ..\..\libcommon 4068;4355;4800;4290;%(DisableSpecificWarnings) @@ -158,7 +158,7 @@ __custom_build_entry__( test.hxx, odb test.hxx, -odb.exe __xml__(__shell_quotes__(m4_patsubst(__value__(odb_options), @database@, __value__(database)))) test.hxx, +odb.exe __xml__(__shell_quotes__(m4_patsubst(__value__(odb_options), @database@, __value__(database)) -DHAVE_CONFIG_VC_H -I..\..\libcommon)) test.hxx, test-odb.hxx;test-odb.ixx;test-odb.cxx) diff --git a/common/template/template-vc9.vcproj b/common/template/template-vc9.vcproj index cc6d9cd..d6dbd3b 100644 --- a/common/template/template-vc9.vcproj +++ b/common/template/template-vc9.vcproj @@ -46,7 +46,7 @@ AdditionalOptions="/wd4068 /wd4355 /wd4800 /wd4290" Optimization="0" AdditionalIncludeDirectories="..\..\libcommon" - PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE" + PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H" MinimalRebuild="true" BasicRuntimeChecks="3" RuntimeLibrary="3" @@ -123,7 +123,7 @@ Optimization="2" EnableIntrinsicFunctions="true" AdditionalIncludeDirectories="..\..\libcommon" - PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE" + PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;HAVE_CONFIG_VC_H" RuntimeLibrary="2" EnableFunctionLevelLinking="true" UsePrecompiledHeader="0" @@ -200,7 +200,7 @@ AdditionalOptions="/wd4068 /wd4355 /wd4800 /wd4290" Optimization="0" AdditionalIncludeDirectories="..\..\libcommon" - PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE" + PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H" MinimalRebuild="true" BasicRuntimeChecks="3" RuntimeLibrary="3" @@ -278,7 +278,7 @@ Optimization="2" EnableIntrinsicFunctions="true" AdditionalIncludeDirectories="..\..\libcommon" - PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE" + PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;HAVE_CONFIG_VC_H" RuntimeLibrary="2" EnableFunctionLevelLinking="true" UsePrecompiledHeader="0" @@ -348,7 +348,7 @@ __source_entries__(extra_sources) __file_entry_custom_build__( test.hxx, odb test.hxx, -odb.exe __xml__(__shell_quotes__(m4_patsubst(__value__(odb_options), @database@, __value__(database)))) test.hxx, +odb.exe __xml__(__shell_quotes__(m4_patsubst(__value__(odb_options), @database@, __value__(database)) -DHAVE_CONFIG_VC_H -I..\..\libcommon)) test.hxx, test-odb.hxx;test-odb.ixx;test-odb.cxx) __file_entry__(test-odb.hxx) __file_entry__(test-odb.ixx) diff --git a/configure.ac b/configure.ac index bb0932c..b7eea10 100644 --- a/configure.ac +++ b/configure.ac @@ -35,6 +35,10 @@ AM_CONDITIONAL([ODB_TESTS_THREADS], [test x$threads != xnone]) LIBODB([], [AC_MSG_ERROR([libodb is not found; consider using --with-libodb=DIR])]) LIBODB_TRACER([], [AC_MSG_ERROR([libodb-tracer is not found; consider using --with-libodb-tracer=DIR])]) +# Check for TR1 availability. +# +TR1_MEMORY + # Check which database we are using. # DATABASE diff --git a/libcommon/common/common.cxx b/libcommon/common/common.cxx index a2a2e64..a15ab93 100644 --- a/libcommon/common/common.cxx +++ b/libcommon/common/common.cxx @@ -6,9 +6,7 @@ #include // std::exit #include -#ifndef _MSC_VER -# include -#endif +#include #if defined(DATABASE_MYSQL) # include diff --git a/libcommon/common/config-vc.h b/libcommon/common/config-vc.h new file mode 100644 index 0000000..fa739a4 --- /dev/null +++ b/libcommon/common/config-vc.h @@ -0,0 +1,14 @@ +/* file : libcommon/common/config-vc.h + * author : Boris Kolpackov + * copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC + * license : GNU GPL v2; see accompanying LICENSE file + */ + +/* Configuration file for Windows/VC++. */ + +#ifndef LIBCOMMON_COMMON_CONFIG_VC_H +#define LIBCOMMON_COMMON_CONFIG_VC_H + +#define HAVE_TR1_MEMORY + +#endif /* LIBCOMMON_COMMON_CONFIG_VC_H */ diff --git a/libcommon/common/config.h.in b/libcommon/common/config.h.in index d0b2bd9..a1140e1 100644 --- a/libcommon/common/config.h.in +++ b/libcommon/common/config.h.in @@ -10,6 +10,7 @@ #define LIBCOMMON_COMMON_CONFIG_H #undef DATABASE_MYSQL +#undef HAVE_TR1_MEMORY #undef LIBCOMMON_STATIC_LIB #endif /* LIBCOMMON_COMMON_CONFIG_H */ diff --git a/libcommon/common/config.hxx b/libcommon/common/config.hxx new file mode 100644 index 0000000..c08be65 --- /dev/null +++ b/libcommon/common/config.hxx @@ -0,0 +1,15 @@ +// file : libcommon/common/config.hxx +// author : Boris Kolpackov +// copyright : Copyright (c) 2005-2010 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef LIBCOMMON_COMMON_CONFIG_HXX +#define LIBCOMMON_COMMON_CONFIG_HXX + +#ifdef HAVE_CONFIG_VC_H +# include +#else +# include +#endif + +#endif // LIBCOMMON_COMMON_CONFIG_HXX diff --git a/libcommon/common/export.hxx b/libcommon/common/export.hxx index 4ea2d33..5a7fed1 100644 --- a/libcommon/common/export.hxx +++ b/libcommon/common/export.hxx @@ -6,9 +6,7 @@ #ifndef LIBCOMMON_COMMON_EXPORT_HXX #define LIBCOMMON_COMMON_EXPORT_HXX -#ifndef _MSC_VER -# include -#endif +#include #ifdef LIBCOMMON_STATIC_LIB # define LIBCOMMON_EXPORT diff --git a/libcommon/common/libcommon-vc10.vcxproj b/libcommon/common/libcommon-vc10.vcxproj index 44034da..69494b0 100644 --- a/libcommon/common/libcommon-vc10.vcxproj +++ b/libcommon/common/libcommon-vc10.vcxproj @@ -1,4 +1,4 @@ - + @@ -88,7 +88,7 @@ Level3 Disabled - WIN32;_DEBUG;_WINDOWS;_USRDLL;__upcase__(database_)__upcase__(__value__(database));LIBCOMMON_DYNAMIC_LIB;%(PreprocessorDefinitions) + WIN32;_DEBUG;_WINDOWS;_USRDLL;HAVE_CONFIG_VC_H;__upcase__(database_)__upcase__(__value__(database));LIBCOMMON_DYNAMIC_LIB;%(PreprocessorDefinitions) .. 4355;4800;4290;4251;%(DisableSpecificWarnings) @@ -106,7 +106,7 @@ Level3 Disabled - WIN32;_DEBUG;_WINDOWS;_USRDLL;__upcase__(database_)__upcase__(__value__(database));LIBCOMMON_DYNAMIC_LIB;%(PreprocessorDefinitions) + WIN32;_DEBUG;_WINDOWS;_USRDLL;HAVE_CONFIG_VC_H;__upcase__(database_)__upcase__(__value__(database));LIBCOMMON_DYNAMIC_LIB;%(PreprocessorDefinitions) .. 4355;4800;4290;4251;%(DisableSpecificWarnings) @@ -126,7 +126,7 @@ MaxSpeed true true - WIN32;NDEBUG;_WINDOWS;_USRDLL;__upcase__(database_)__upcase__(__value__(database));LIBCOMMON_DYNAMIC_LIB;%(PreprocessorDefinitions) + WIN32;NDEBUG;_WINDOWS;_USRDLL;HAVE_CONFIG_VC_H;__upcase__(database_)__upcase__(__value__(database));LIBCOMMON_DYNAMIC_LIB;%(PreprocessorDefinitions) .. 4355;4800;4290;4251;%(DisableSpecificWarnings) @@ -148,7 +148,7 @@ MaxSpeed true true - WIN32;NDEBUG;_WINDOWS;_USRDLL;__upcase__(database_)__upcase__(__value__(database));LIBCOMMON_DYNAMIC_LIB;%(PreprocessorDefinitions) + WIN32;NDEBUG;_WINDOWS;_USRDLL;HAVE_CONFIG_VC_H;__upcase__(database_)__upcase__(__value__(database));LIBCOMMON_DYNAMIC_LIB;%(PreprocessorDefinitions) .. 4355;4800;4290;4251;%(DisableSpecificWarnings) diff --git a/libcommon/common/libcommon-vc9.vcproj b/libcommon/common/libcommon-vc9.vcproj index c7ef766..a7ec116 100644 --- a/libcommon/common/libcommon-vc9.vcproj +++ b/libcommon/common/libcommon-vc9.vcproj @@ -46,7 +46,7 @@ AdditionalOptions="/wd4355 /wd4800 /wd4290" Optimization="0" AdditionalIncludeDirectories=".." - PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;__upcase__(database_)__upcase__(__value__(database));LIBCOMMON_DYNAMIC_LIB" + PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;HAVE_CONFIG_VC_H;__upcase__(database_)__upcase__(__value__(database));LIBCOMMON_DYNAMIC_LIB" MinimalRebuild="true" BasicRuntimeChecks="3" RuntimeLibrary="3" @@ -124,7 +124,7 @@ AdditionalOptions="/wd4355 /wd4800 /wd4290" Optimization="0" AdditionalIncludeDirectories=".." - PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;__upcase__(database_)__upcase__(__value__(database));__upcase__(database_)__upcase__(__value__(database));__upcase__(database_)__upcase__(__value__(database));LIBCOMMON_DYNAMIC_LIB" + PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;HAVE_CONFIG_VC_H;__upcase__(database_)__upcase__(__value__(database));__upcase__(database_)__upcase__(__value__(database));__upcase__(database_)__upcase__(__value__(database));LIBCOMMON_DYNAMIC_LIB" MinimalRebuild="true" BasicRuntimeChecks="3" RuntimeLibrary="3" @@ -203,7 +203,7 @@ Optimization="2" EnableIntrinsicFunctions="true" AdditionalIncludeDirectories=".." - PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;__upcase__(database_)__upcase__(__value__(database));LIBCOMMON_DYNAMIC_LIB" + PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;HAVE_CONFIG_VC_H;__upcase__(database_)__upcase__(__value__(database));LIBCOMMON_DYNAMIC_LIB" RuntimeLibrary="2" EnableFunctionLevelLinking="true" UsePrecompiledHeader="0" @@ -284,7 +284,7 @@ Optimization="2" EnableIntrinsicFunctions="true" AdditionalIncludeDirectories=".." - PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;__upcase__(database_)__upcase__(__value__(database));LIBCOMMON_DYNAMIC_LIB" + PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;HAVE_CONFIG_VC_H;__upcase__(database_)__upcase__(__value__(database));LIBCOMMON_DYNAMIC_LIB" RuntimeLibrary="2" EnableFunctionLevelLinking="true" UsePrecompiledHeader="0" diff --git a/libcommon/common/makefile b/libcommon/common/makefile index c9ecdaf..6259e69 100644 --- a/libcommon/common/makefile +++ b/libcommon/common/makefile @@ -42,8 +42,9 @@ $(common.l.cpp-options): value := -I$(out_root)/libcommon -I$(src_root)/libcommo $(common.l.cpp-options): $(odb_db.l.cpp-options) $(odb.l.cpp-options) $(out_base)/config.h: $(dcf_root)/configuration-dynamic.make - @echo '// file : libcommon/config.h' >$@ - @echo '// author : automatically generated' >>$@ + @echo '/* file : libcommon/common/config.h' >$@ + @echo ' * author : automatically generated' >>$@ + @echo ' */' >>$@ @echo '' >>$@ @echo '#ifndef LIBCOMMON_COMMON_CONFIG_H' >>$@ @echo '#define LIBCOMMON_COMMON_CONFIG_H' >>$@ @@ -51,8 +52,9 @@ $(out_base)/config.h: $(dcf_root)/configuration-dynamic.make ifeq ($(db_id),mysql) @echo '#define DATABASE_MYSQL 1' >>$@ endif + @echo '#define HAVE_TR1_MEMORY 1' >>$@ @echo '' >>$@ - @echo '#endif // LIBCOMMON_COMMON_CONFIG_H' >>$@ + @echo '#endif /* LIBCOMMON_COMMON_CONFIG_H */' >>$@ $(call include-dep,$(cxx_od),$(cxx_obj),$(out_base)/config.h) diff --git a/m4/tr1-memory.m4 b/m4/tr1-memory.m4 new file mode 100644 index 0000000..7b78577 --- /dev/null +++ b/m4/tr1-memory.m4 @@ -0,0 +1,40 @@ +dnl file : m4/tr1-memory.m4 +dnl author : Boris Kolpackov +dnl copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +dnl license : GNU GPL v2; see accompanying LICENSE file +dnl +dnl TR1_MEMORY +dnl +dnl Check for TR1 availability. If successful, define HAVE_TR1_MEMORY +dnl as both a macro and conditional as well as set the tr1_memory variable +dnl to 'yes'. +dnl +AC_DEFUN([TR1_MEMORY], +[ +tr1_memory=no + +AC_MSG_CHECKING([for TR1 ]) + +CXX_LIBTOOL_LINK_IFELSE( +AC_LANG_SOURCE([[ +#include + +int +main () +{ + std::tr1::shared_ptr p (new int (10)); + *p = 11; +} +]]), +[tr1_memory=yes]) + +if test x"$tr1_memory" = xyes; then + AC_MSG_RESULT([yes]) + AC_DEFINE([HAVE_TR1_MEMORY], [1], [Have TR1 .]) +else + AC_MSG_RESULT([no]) +fi + +AM_CONDITIONAL([HAVE_TR1_MEMORY], [test x$tr1_memory = xyes]) + +])dnl diff --git a/mysql/template/Makefile.am b/mysql/template/Makefile.am index 7f33a6c..31eea41 100644 --- a/mysql/template/Makefile.am +++ b/mysql/template/Makefile.am @@ -24,7 +24,8 @@ CLEANFILES = test-odb.hxx test-odb.ixx test-odb.cxx ODB = @ODB@ ODBFLAGS = @ODBFLAGS@ +ODBCPPFLAGS = @ODBCPPFLAGS@ test-odb.hxx: test.hxx - $(ODB) $(ODBCPPFLAGS) $(CPPFLAGS) $(ODBFLAGS) __value__(odb_options) $< + $(ODB) $(AM_CPPFLAGS) $(ODBCPPFLAGS) $(CPPFLAGS) $(ODBFLAGS) __value__(odb_options) $< ) diff --git a/mysql/template/template-vc10.vcxproj b/mysql/template/template-vc10.vcxproj index a22100c..a39d43a 100644 --- a/mysql/template/template-vc10.vcxproj +++ b/mysql/template/template-vc10.vcxproj @@ -1,4 +1,4 @@ - + @@ -88,7 +88,7 @@ Level3 Disabled - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) ..\..\libcommon 4068;4355;4800;4290;%(DisableSpecificWarnings) @@ -104,7 +104,7 @@ Level3 Disabled - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) ..\..\libcommon 4068;4355;4800;4290;%(DisableSpecificWarnings) @@ -122,7 +122,7 @@ MaxSpeed true true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + WIN32;NDEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) ..\..\libcommon 4068;4355;4800;4290;%(DisableSpecificWarnings) @@ -142,7 +142,7 @@ MaxSpeed true true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + WIN32;NDEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) ..\..\libcommon 4068;4355;4800;4290;%(DisableSpecificWarnings) @@ -160,7 +160,7 @@ m4_dnl __custom_build_entry__( test.hxx, odb test.hxx, -odb.exe __xml__(__shell_quotes__(__value__(odb_options))) test.hxx, +odb.exe __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -I..\..\libcommon)) test.hxx, test-odb.hxx;test-odb.ixx;test-odb.cxx) ) diff --git a/mysql/template/template-vc9.vcproj b/mysql/template/template-vc9.vcproj index a4e71d9..ac0810a 100644 --- a/mysql/template/template-vc9.vcproj +++ b/mysql/template/template-vc9.vcproj @@ -46,7 +46,7 @@ AdditionalOptions="/wd4068 /wd4355 /wd4800 /wd4290" Optimization="0" AdditionalIncludeDirectories="..\..\libcommon" - PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE" + PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H" MinimalRebuild="true" BasicRuntimeChecks="3" RuntimeLibrary="3" @@ -123,7 +123,7 @@ Optimization="2" EnableIntrinsicFunctions="true" AdditionalIncludeDirectories="..\..\libcommon" - PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE" + PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;HAVE_CONFIG_VC_H" RuntimeLibrary="2" EnableFunctionLevelLinking="true" UsePrecompiledHeader="0" @@ -200,7 +200,7 @@ AdditionalOptions="/wd4068 /wd4355 /wd4800 /wd4290" Optimization="0" AdditionalIncludeDirectories="..\..\libcommon" - PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE" + PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H" MinimalRebuild="true" BasicRuntimeChecks="3" RuntimeLibrary="3" @@ -278,7 +278,7 @@ Optimization="2" EnableIntrinsicFunctions="true" AdditionalIncludeDirectories="..\..\libcommon" - PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE" + PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;HAVE_CONFIG_VC_H" RuntimeLibrary="2" EnableFunctionLevelLinking="true" UsePrecompiledHeader="0" @@ -349,7 +349,7 @@ m4_ifelse(__value__(odb_options),,, __file_entry_custom_build__( test.hxx, odb test.hxx, -odb.exe __xml__(__shell_quotes__(__value__(odb_options))) test.hxx, +odb.exe __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -I..\..\libcommon)) test.hxx, test-odb.hxx;test-odb.ixx;test-odb.cxx) __file_entry__(test-odb.hxx) __file_entry__(test-odb.ixx)) diff --git a/tracer/template/Makefile.am b/tracer/template/Makefile.am index 6edccff..f594a51 100644 --- a/tracer/template/Makefile.am +++ b/tracer/template/Makefile.am @@ -7,6 +7,7 @@ EXTRA_DIST = __file__(extra_dist) noinst_PROGRAMS = driver driver_SOURCES = driver.cxx __path__(extra_sources) __path__(extra_headers) +AM_CPPFLAGS = -I'$(top_builddir)/libcommon' -I'$(top_srcdir)/libcommon' TESTS=$(top_builddir)/tester TESTS_ENVIRONMENT=top_builddir=$(top_builddir); export top_builddir; @@ -22,7 +23,8 @@ CLEANFILES = test-odb.hxx test-odb.ixx test-odb.cxx ODB = @ODB@ ODBFLAGS = @ODBFLAGS@ +ODBCPPFLAGS = @ODBCPPFLAGS@ test-odb.hxx: test.hxx - $(ODB) $(ODBCPPFLAGS) $(CPPFLAGS) $(ODBFLAGS) __value__(odb_options) $< + $(ODB) $(AM_CPPFLAGS) $(ODBCPPFLAGS) $(CPPFLAGS) $(ODBFLAGS) __value__(odb_options) $< ) diff --git a/tracer/template/template-vc10.vcxproj b/tracer/template/template-vc10.vcxproj index a385bad..d2e5ae0 100644 --- a/tracer/template/template-vc10.vcxproj +++ b/tracer/template/template-vc10.vcxproj @@ -1,4 +1,4 @@ - + @@ -88,7 +88,8 @@ Level3 Disabled - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + ..\..\libcommon 4068;4355;4800;4290;%(DisableSpecificWarnings) @@ -103,7 +104,8 @@ Level3 Disabled - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + ..\..\libcommon 4068;4355;4800;4290;%(DisableSpecificWarnings) @@ -120,7 +122,8 @@ MaxSpeed true true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + WIN32;NDEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + ..\..\libcommon 4068;4355;4800;4290;%(DisableSpecificWarnings) @@ -139,7 +142,8 @@ MaxSpeed true true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + WIN32;NDEBUG;_CONSOLE;HAVE_CONFIG_VC_H;%(PreprocessorDefinitions) + ..\..\libcommon 4068;4355;4800;4290;%(DisableSpecificWarnings) @@ -156,7 +160,7 @@ m4_dnl __custom_build_entry__( test.hxx, odb test.hxx, -odb.exe __xml__(__shell_quotes__(__value__(odb_options))) test.hxx, +odb.exe __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -I..\..\libcommon)) test.hxx, test-odb.hxx;test-odb.ixx;test-odb.cxx) ) diff --git a/tracer/template/template-vc9.vcproj b/tracer/template/template-vc9.vcproj index e12ab89..73649a4 100644 --- a/tracer/template/template-vc9.vcproj +++ b/tracer/template/template-vc9.vcproj @@ -45,7 +45,8 @@ Name="VCCLCompilerTool" AdditionalOptions="/wd4068 /wd4355 /wd4800 /wd4290" Optimization="0" - PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE" + AdditionalIncludeDirectories="..\..\libcommon" + PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H" MinimalRebuild="true" BasicRuntimeChecks="3" RuntimeLibrary="3" @@ -121,7 +122,8 @@ AdditionalOptions="/wd4068 /wd4355 /wd4800 /wd4290" Optimization="2" EnableIntrinsicFunctions="true" - PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE" + AdditionalIncludeDirectories="..\..\libcommon" + PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;HAVE_CONFIG_VC_H" RuntimeLibrary="2" EnableFunctionLevelLinking="true" UsePrecompiledHeader="0" @@ -197,7 +199,8 @@ Name="VCCLCompilerTool" AdditionalOptions="/wd4068 /wd4355 /wd4800 /wd4290" Optimization="0" - PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE" + AdditionalIncludeDirectories="..\..\libcommon" + PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;HAVE_CONFIG_VC_H" MinimalRebuild="true" BasicRuntimeChecks="3" RuntimeLibrary="3" @@ -274,7 +277,8 @@ AdditionalOptions="/wd4068 /wd4355 /wd4800 /wd4290" Optimization="2" EnableIntrinsicFunctions="true" - PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE" + AdditionalIncludeDirectories="..\..\libcommon" + PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;HAVE_CONFIG_VC_H" RuntimeLibrary="2" EnableFunctionLevelLinking="true" UsePrecompiledHeader="0" @@ -345,7 +349,7 @@ m4_ifelse(__value__(odb_options),,, __file_entry_custom_build__( test.hxx, odb test.hxx, -odb.exe __xml__(__shell_quotes__(__value__(odb_options))) test.hxx, +odb.exe __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -I..\..\libcommon)) test.hxx, test-odb.hxx;test-odb.ixx;test-odb.cxx) __file_entry__(test-odb.hxx) __file_entry__(test-odb.ixx)) -- cgit v1.1