From ff5bb2accee87c24ee64e8fdcf5169e674c4b7b4 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 8 Sep 2010 21:23:37 +0200 Subject: Add suppor for VC++ build --- mysql/Makefile.am | 1 + mysql/makefile | 8 + mysql/mysql-vc10.sln | 15 ++ mysql/mysql-vc9.sln | 15 ++ mysql/template/Makefile.am | 6 +- mysql/template/driver.cxx | 2 +- mysql/template/makefile | 25 +- mysql/template/template-vc10.vcxproj | 176 +++++++++++++ mysql/template/template-vc10.vcxproj.filters | 25 ++ mysql/template/template-vc9.vcproj | 357 +++++++++++++++++++++++++++ mysql/truncation/driver.cxx | 2 +- mysql/truncation/makefile | 25 +- mysql/types/driver.cxx | 4 +- mysql/types/makefile | 25 +- 14 files changed, 647 insertions(+), 39 deletions(-) create mode 100644 mysql/mysql-vc10.sln create mode 100644 mysql/mysql-vc9.sln create mode 100644 mysql/template/template-vc10.vcxproj create mode 100644 mysql/template/template-vc10.vcxproj.filters create mode 100644 mysql/template/template-vc9.vcproj (limited to 'mysql') diff --git a/mysql/Makefile.am b/mysql/Makefile.am index 1e8c1c0..d07384b 100644 --- a/mysql/Makefile.am +++ b/mysql/Makefile.am @@ -4,3 +4,4 @@ # license : GNU GPL v2; see accompanying LICENSE file SUBDIRS = __path__(dirs) +EXTRA_DIST = __file__(extra_dist) diff --git a/mysql/makefile b/mysql/makefile index 53dd049..4b94e4c 100644 --- a/mysql/makefile +++ b/mysql/makefile @@ -17,13 +17,21 @@ clean := $(out_base)/.clean $(default): $(addprefix $(out_base)/,$(addsuffix /,$(tests))) +$(dist): name := $(notdir $(src_base)) $(dist): export dirs := $(tests) +$(dist): export extra_dist := $(name)-vc9.sln $(name)-vc10.sln tests.bat $(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(tests))) $(call meta-automake) + $(call meta-vc9sln,$(name)-vc9.sln) + $(call meta-vc10sln,$(name)-vc10.sln) + $(call meta-vctest,$(name)-vc10.sln,$(src_root)/test.bat) $(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(tests))) $(clean): $(addprefix $(out_base)/,$(addsuffix /.clean,$(tests))) +$(call include,$(bld_root)/meta/vc9sln.make) +$(call include,$(bld_root)/meta/vc10sln.make) +$(call include,$(bld_root)/meta/vctest.make) $(call include,$(bld_root)/meta/automake.make) $(foreach t,$(tests),$(call import,$(src_base)/$t/makefile)) diff --git a/mysql/mysql-vc10.sln b/mysql/mysql-vc10.sln new file mode 100644 index 0000000..9a5dc32 --- /dev/null +++ b/mysql/mysql-vc10.sln @@ -0,0 +1,15 @@ + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +__projects__ +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution +__solution_configurations__ + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution +__project_configurations__ + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/mysql/mysql-vc9.sln b/mysql/mysql-vc9.sln new file mode 100644 index 0000000..2ec9432 --- /dev/null +++ b/mysql/mysql-vc9.sln @@ -0,0 +1,15 @@ + +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual Studio 2008 +__projects__ +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution +__solution_configurations__ + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution +__project_configurations__ + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/mysql/template/Makefile.am b/mysql/template/Makefile.am index 46c3bae..229e071 100644 --- a/mysql/template/Makefile.am +++ b/mysql/template/Makefile.am @@ -3,13 +3,15 @@ # copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC # license : GNU GPL v2; see accompanying LICENSE file +EXTRA_DIST = __file__(extra_dist) + noinst_PROGRAMS = driver driver_SOURCES = driver.cxx __path__(extra_sources) __path__(extra_headers) -driver_LDADD = $(top_builddir)/libcommon/libcommon.la +driver_LDADD = $(top_builddir)/libcommon/common/libcommon.la driver_CPPFLAGS = -I'$(top_builddir)/libcommon' -I'$(top_srcdir)/libcommon' TESTS=$(top_builddir)/tester -TESTS_ENVIRONMENT=top_builddir=$(top_builddir); +TESTS_ENVIRONMENT=top_builddir=$(top_builddir); export top_builddir; m4_ifelse(__value__(odb_options),,, diff --git a/mysql/template/driver.cxx b/mysql/template/driver.cxx index 4f1bb52..45a73eb 100644 --- a/mysql/template/driver.cxx +++ b/mysql/template/driver.cxx @@ -13,7 +13,7 @@ #include #include -#include +#include #include "test.hxx" #include "test-odb.hxx" diff --git a/mysql/template/makefile b/mysql/template/makefile index 28146f4..d634728 100644 --- a/mysql/template/makefile +++ b/mysql/template/makefile @@ -10,20 +10,14 @@ odb_hdr := test.hxx cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o) $(odb_hdr:.hxx=-odb.o)) cxx_od := $(cxx_obj:.o=.o.d) -common.l := $(out_root)/libcommon/common.l -common.l.cpp-options := $(out_root)/libcommon/common.l.cpp-options +common.l := $(out_root)/libcommon/common/common.l +common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options driver := $(out_base)/driver dist := $(out_base)/.dist test := $(out_base)/.test clean := $(out_base)/.clean -ifdef db_id -ifneq ($(db_id),mysql) -$(error trying to build a MySQL-specific test with $(db_id)) -endif -endif - # Import. # $(call import,\ @@ -53,10 +47,17 @@ $(out_base)/: $(driver) # Dist # -$(dist): data_dist := $(cxx_tun) $(odb_hdr) test.std +$(dist): sources := $(cxx_tun) +$(dist): headers := $(odb_hdr) +$(dist): data_dist := test.std +$(dist): export name := $(notdir $(src_base)) +$(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ +$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters $(dist): - $(call dist-data,$(data_dist)) - $(call meta-automake) + $(call dist-data,$(sources) $(headers) $(data_dist)) + $(call meta-automake,../template/Makefile.am) + $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) + $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) # Test. # @@ -87,6 +88,8 @@ 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,$(odb_rules)) diff --git a/mysql/template/template-vc10.vcxproj b/mysql/template/template-vc10.vcxproj new file mode 100644 index 0000000..a6f172c --- /dev/null +++ b/mysql/template/template-vc10.vcxproj @@ -0,0 +1,176 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {__uuid__()} + Win32Proj + __value__(name) + + + + Application + true + Unicode + + + Application + true + Unicode + + + Application + false + true + Unicode + + + Application + false + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(Configuration)\ + driver + + + true + $(Platform)\$(Configuration)\ + driver + + + false + $(Configuration)\ + driver + + + false + $(Platform)\$(Configuration)\ + driver + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + ..\..\libcommon + + + ..\..\libcommon\lib\common-d.lib;odb-mysql-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + ..\..\libcommon + + + ..\..\libcommon\lib\common-d.lib;odb-mysql-d.lib;odb-d.lib;%(AdditionalDependencies) + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + ..\..\libcommon + + + ..\..\libcommon\lib\common.lib;odb-mysql.lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + ..\..\libcommon + + + ..\..\libcommon\lib\common.lib;odb-mysql.lib;odb.lib;%(AdditionalDependencies) + Console + true + true + true + + +m4_ifelse(__value__(odb_options),,, +m4_dnl + +__custom_build_entry__( +test.hxx, +odb test.hxx, +odb.exe __xml__(__shell_quotes__(__value__(odb_options))) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) + ) + +m4_ifelse(__value__(odb_options),,, +__header_entry__(test-odb.hxx) +__header_entry__(test-odb.ixx)) +__header_entries__(extra_headers) + + +__source_entry__(driver.cxx) +m4_ifelse(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + + + + diff --git a/mysql/template/template-vc10.vcxproj.filters b/mysql/template/template-vc10.vcxproj.filters new file mode 100644 index 0000000..951015b --- /dev/null +++ b/mysql/template/template-vc10.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {__uuid__()} + cxx + + + {__uuid__()} + h;hxx;ixx;txx + + + +m4_ifelse(__value__(odb_options),,, +__header_filter_entry__(test.hxx) +__header_filter_entry__(test-odb.hxx) +__header_filter_entry__(test-odb.ixx)) +__header_filter_entries__(extra_headers) + + +__source_filter_entry__(driver.cxx) +m4_ifelse(__value__(odb_options),,,__source_filter_entry__(test-odb.cxx)) +__source_filter_entries__(extra_sources) + + \ No newline at end of file diff --git a/mysql/template/template-vc9.vcproj b/mysql/template/template-vc9.vcproj new file mode 100644 index 0000000..a8dbd23 --- /dev/null +++ b/mysql/template/template-vc9.vcproj @@ -0,0 +1,357 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +__source_entry__(driver.cxx) +m4_ifelse(__value__(odb_options),,,__source_entry__(test-odb.cxx)) +__source_entries__(extra_sources) + + +m4_ifelse(__value__(odb_options),,, +__file_entry_custom_build__( +test.hxx, +odb test.hxx, +odb.exe __xml__(__shell_quotes__(__value__(odb_options))) test.hxx, +test-odb.hxx;test-odb.ixx;test-odb.cxx) +__file_entry__(test-odb.hxx) +__file_entry__(test-odb.ixx)) +__file_entries__(extra_headers) + + + + + diff --git a/mysql/truncation/driver.cxx b/mysql/truncation/driver.cxx index 2117a9e..46350d6 100644 --- a/mysql/truncation/driver.cxx +++ b/mysql/truncation/driver.cxx @@ -13,7 +13,7 @@ #include #include -#include +#include #include "test.hxx" #include "test-odb.hxx" diff --git a/mysql/truncation/makefile b/mysql/truncation/makefile index f0d475d..a798c8d 100644 --- a/mysql/truncation/makefile +++ b/mysql/truncation/makefile @@ -10,20 +10,14 @@ odb_hdr := test.hxx cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o) $(odb_hdr:.hxx=-odb.o)) cxx_od := $(cxx_obj:.o=.o.d) -common.l := $(out_root)/libcommon/common.l -common.l.cpp-options := $(out_root)/libcommon/common.l.cpp-options +common.l := $(out_root)/libcommon/common/common.l +common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options driver := $(out_base)/driver dist := $(out_base)/.dist test := $(out_base)/.test clean := $(out_base)/.clean -ifdef db_id -ifneq ($(db_id),mysql) -$(error trying to build a MySQL-specific test with $(db_id)) -endif -endif - # Import. # $(call import,\ @@ -53,10 +47,17 @@ $(out_base)/: $(driver) # Dist # -$(dist): data_dist := $(cxx_tun) $(odb_hdr) test.std +$(dist): sources := $(cxx_tun) +$(dist): headers := $(odb_hdr) +$(dist): data_dist := test.std +$(dist): export name := $(notdir $(src_base)) +$(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ +$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters $(dist): - $(call dist-data,$(data_dist)) - $(call meta-automake,$(src_root)/mysql/template/Makefile.am) + $(call dist-data,$(sources) $(headers) $(data_dist)) + $(call meta-automake,../template/Makefile.am) + $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) + $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) # Test. # @@ -87,6 +88,8 @@ 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,$(odb_rules)) diff --git a/mysql/types/driver.cxx b/mysql/types/driver.cxx index e0d6b42..2a6c94e 100644 --- a/mysql/types/driver.cxx +++ b/mysql/types/driver.cxx @@ -13,7 +13,7 @@ #include #include -#include +#include #include "test.hxx" #include "test-odb.hxx" @@ -42,7 +42,7 @@ main (int argc, char* argv[]) o.long_long_ = -123456; o.ulong_long_ = 123456; - o.float_ = 1.123; + o.float_ = 1.123F; o.double_ = 1.123; o.decimal_ = "123.456"; diff --git a/mysql/types/makefile b/mysql/types/makefile index 859ef29..60ee402 100644 --- a/mysql/types/makefile +++ b/mysql/types/makefile @@ -10,20 +10,14 @@ odb_hdr := test.hxx cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o) $(odb_hdr:.hxx=-odb.o)) cxx_od := $(cxx_obj:.o=.o.d) -common.l := $(out_root)/libcommon/common.l -common.l.cpp-options := $(out_root)/libcommon/common.l.cpp-options +common.l := $(out_root)/libcommon/common/common.l +common.l.cpp-options := $(out_root)/libcommon/common/common.l.cpp-options driver := $(out_base)/driver dist := $(out_base)/.dist test := $(out_base)/.test clean := $(out_base)/.clean -ifdef db_id -ifneq ($(db_id),mysql) -$(error trying to build a MySQL-specific test with $(db_id)) -endif -endif - # Import. # $(call import,\ @@ -55,11 +49,18 @@ $(out_base)/: $(driver) # Dist # -$(dist): data_dist := $(cxx_tun) $(odb_hdr) traits.hxx test.std +$(dist): sources := $(cxx_tun) +$(dist): headers := $(odb_hdr) $(dist): export extra_headers := traits.hxx +$(dist): data_dist := test.std +$(dist): export name := $(notdir $(src_base)) +$(dist): export extra_dist := $(data_dist) $(name)-vc9.vcproj \ +$(name)-vc10.vcxproj $(name)-vc10.vcxproj.filters $(dist): - $(call dist-data,$(data_dist)) - $(call meta-automake,$(src_root)/mysql/template/Makefile.am) + $(call dist-data,$(sources) $(headers) $(extra_headers) $(data_dist)) + $(call meta-automake,../template/Makefile.am) + $(call meta-vc9proj,../template/template-vc9.vcproj,$(name)-vc9.vcproj) + $(call meta-vc10proj,../template/template-vc10.vcxproj,$(name)-vc10.vcxproj) # Test. # @@ -90,6 +91,8 @@ 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,$(odb_rules)) -- cgit v1.1