From 19d0eb2adcda31d9919bca8fef98cb1871b4ce54 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 14 Sep 2010 19:01:49 +0200 Subject: Add automake and VC++ builds (meta-build) --- cutl/Makefile.am | 15 ++ cutl/compiler/context.hxx | 8 +- cutl/compiler/type-id.hxx | 4 +- cutl/compiler/type-info.hxx | 14 +- cutl/container/any.hxx | 8 +- cutl/container/graph.hxx | 6 +- cutl/cutl-8.0.sln | 20 --- cutl/cutl-8.0.vcproj | 214 ----------------------- cutl/cutl-9.0.sln | 20 --- cutl/cutl-9.0.vcproj | 215 ----------------------- cutl/details/config.h.in | 14 ++ cutl/details/config.hxx | 14 ++ cutl/details/export.hxx | 37 ++++ cutl/exception.hxx | 4 +- cutl/fs/auto-remove.hxx | 6 +- cutl/fs/exception.hxx | 2 +- cutl/fs/path.hxx | 4 +- cutl/libcutl-vc10.vcxproj | 170 ++++++++++++++++++ cutl/libcutl-vc10.vcxproj.filters | 19 ++ cutl/libcutl-vc9.vcproj | 355 ++++++++++++++++++++++++++++++++++++++ cutl/makefile | 50 +++++- cutl/shared-ptr/base.hxx | 16 +- 22 files changed, 717 insertions(+), 498 deletions(-) create mode 100644 cutl/Makefile.am delete mode 100644 cutl/cutl-8.0.sln delete mode 100644 cutl/cutl-8.0.vcproj delete mode 100644 cutl/cutl-9.0.sln delete mode 100644 cutl/cutl-9.0.vcproj create mode 100644 cutl/details/config.h.in create mode 100644 cutl/details/config.hxx create mode 100644 cutl/details/export.hxx create mode 100644 cutl/libcutl-vc10.vcxproj create mode 100644 cutl/libcutl-vc10.vcxproj.filters create mode 100644 cutl/libcutl-vc9.vcproj (limited to 'cutl') diff --git a/cutl/Makefile.am b/cutl/Makefile.am new file mode 100644 index 0000000..53859e4 --- /dev/null +++ b/cutl/Makefile.am @@ -0,0 +1,15 @@ +# file : cutl/Makefile.am +# author : Boris Kolpackov +# copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +# license : MIT; see accompanying LICENSE file + +EXTRA_DIST = __file__(extra_dist) + +lib_LTLIBRARIES = libcutl.la +libcutl_la_SOURCES = __path__(sources) + +cutlincludedir = $(includedir)/cutl +nobase_cutlinclude_HEADERS = __path__(headers) + +AM_CPPFLAGS = -I$(top_builddir) -I$(top_srcdir) +libcutl_la_LDFLAGS = -release __value__(interface_version) diff --git a/cutl/compiler/context.hxx b/cutl/compiler/context.hxx index 32f301f..f5d2c6d 100644 --- a/cutl/compiler/context.hxx +++ b/cutl/compiler/context.hxx @@ -13,15 +13,17 @@ #include #include +#include + namespace cutl { namespace compiler { - class context + class LIBCUTL_EXPORT context { public: - struct no_entry: exception {}; - struct typing: exception {}; + struct LIBCUTL_EXPORT no_entry: exception {}; + struct LIBCUTL_EXPORT typing: exception {}; public: context () {} diff --git a/cutl/compiler/type-id.hxx b/cutl/compiler/type-id.hxx index 099da6d..87ffad4 100644 --- a/cutl/compiler/type-id.hxx +++ b/cutl/compiler/type-id.hxx @@ -8,11 +8,13 @@ #include // std::type_info +#include + namespace cutl { namespace compiler { - class type_id + class LIBCUTL_EXPORT type_id { public: template diff --git a/cutl/compiler/type-info.hxx b/cutl/compiler/type-info.hxx index b005ec4..b69451c 100644 --- a/cutl/compiler/type-info.hxx +++ b/cutl/compiler/type-info.hxx @@ -14,6 +14,8 @@ #include #include +#include + namespace cutl { namespace compiler @@ -26,7 +28,7 @@ namespace cutl // // - class base_info + class LIBCUTL_EXPORT base_info { public: base_info (type_id const&); @@ -45,7 +47,7 @@ namespace cutl // // - class type_info + class LIBCUTL_EXPORT type_info { typedef std::vector bases; @@ -77,12 +79,12 @@ namespace cutl // // - class no_type_info: exception {}; + class LIBCUTL_EXPORT no_type_info: exception {}; - type_info const& + LIBCUTL_EXPORT type_info const& lookup (type_id const&); - type_info const& + LIBCUTL_EXPORT type_info const& lookup (std::type_info const&); template @@ -93,7 +95,7 @@ namespace cutl type_info const& lookup (); - void + LIBCUTL_EXPORT void insert (type_info const&); namespace bits diff --git a/cutl/container/any.hxx b/cutl/container/any.hxx index 8999fbb..feeb302 100644 --- a/cutl/container/any.hxx +++ b/cutl/container/any.hxx @@ -11,14 +11,16 @@ #include +#include + namespace cutl { namespace container { - class any + class LIBCUTL_EXPORT any { public: - struct typing: exception {}; + struct LIBCUTL_EXPORT typing: exception {}; public: template @@ -76,7 +78,7 @@ namespace cutl } private: - class holder + class LIBCUTL_EXPORT holder { public: virtual diff --git a/cutl/container/graph.hxx b/cutl/container/graph.hxx index 9244351..e797c22 100644 --- a/cutl/container/graph.hxx +++ b/cutl/container/graph.hxx @@ -11,12 +11,14 @@ #include #include +#include + namespace cutl { namespace container { - struct no_edge: exception {}; - struct no_node: exception {}; + struct LIBCUTL_EXPORT no_edge: exception {}; + struct LIBCUTL_EXPORT no_node: exception {}; template class graph diff --git a/cutl/cutl-8.0.sln b/cutl/cutl-8.0.sln deleted file mode 100644 index e5e8477..0000000 --- a/cutl/cutl-8.0.sln +++ /dev/null @@ -1,20 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual Studio 2005 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cutl", "cutl-8.0.vcproj", "{162AFFCF-ABD2-46F3-97A8-642F1256D8B5}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Release|Win32 = Release|Win32 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {162AFFCF-ABD2-46F3-97A8-642F1256D8B5}.Debug|Win32.ActiveCfg = Debug|Win32 - {162AFFCF-ABD2-46F3-97A8-642F1256D8B5}.Debug|Win32.Build.0 = Debug|Win32 - {162AFFCF-ABD2-46F3-97A8-642F1256D8B5}.Release|Win32.ActiveCfg = Release|Win32 - {162AFFCF-ABD2-46F3-97A8-642F1256D8B5}.Release|Win32.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/cutl/cutl-8.0.vcproj b/cutl/cutl-8.0.vcproj deleted file mode 100644 index 82164d3..0000000 --- a/cutl/cutl-8.0.vcproj +++ /dev/null @@ -1,214 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/cutl/cutl-9.0.sln b/cutl/cutl-9.0.sln deleted file mode 100644 index 33a21d7..0000000 --- a/cutl/cutl-9.0.sln +++ /dev/null @@ -1,20 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 10.00 -# Visual Studio 2008 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cutl", "cutl-9.0.vcproj", "{630FA2F0-018B-463D-A56C-59EC72CC6521}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Release|Win32 = Release|Win32 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {630FA2F0-018B-463D-A56C-59EC72CC6521}.Debug|Win32.ActiveCfg = Debug|Win32 - {630FA2F0-018B-463D-A56C-59EC72CC6521}.Debug|Win32.Build.0 = Debug|Win32 - {630FA2F0-018B-463D-A56C-59EC72CC6521}.Release|Win32.ActiveCfg = Release|Win32 - {630FA2F0-018B-463D-A56C-59EC72CC6521}.Release|Win32.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/cutl/cutl-9.0.vcproj b/cutl/cutl-9.0.vcproj deleted file mode 100644 index 4416aa6..0000000 --- a/cutl/cutl-9.0.vcproj +++ /dev/null @@ -1,215 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/cutl/details/config.h.in b/cutl/details/config.h.in new file mode 100644 index 0000000..18b8f9d --- /dev/null +++ b/cutl/details/config.h.in @@ -0,0 +1,14 @@ +/* file : cutl/details/config.h.in + * author : Boris Kolpackov + * copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC + * license : MIT; see accompanying LICENSE file + */ + +/* This file is automatically processed by configure. */ + +#ifndef CUTL_DETAILS_CONFIG_H +#define CUTL_DETAILS_CONFIG_H + +#undef LIBCUTL_STATIC_LIB + +#endif /* CUTL_DETAILS_CONFIG_H */ diff --git a/cutl/details/config.hxx b/cutl/details/config.hxx new file mode 100644 index 0000000..2bbc274 --- /dev/null +++ b/cutl/details/config.hxx @@ -0,0 +1,14 @@ +// file : cutl/details/config.hxx +// author : Boris Kolpackov +// copyright : Copyright (c) 2005-2010 Code Synthesis Tools CC +// license : MIT; see accompanying LICENSE file + +#ifndef CUTL_DETAILS_CONFIG_HXX +#define CUTL_DETAILS_CONFIG_HXX + +#ifdef _MSC_VER +#else +# include +#endif + +#endif // CUTL_DETAILS_CONFIG_HXX diff --git a/cutl/details/export.hxx b/cutl/details/export.hxx new file mode 100644 index 0000000..4c7b494 --- /dev/null +++ b/cutl/details/export.hxx @@ -0,0 +1,37 @@ +// file : cutl/details/export.hxx +// author : Boris Kolpackov +// copyright : Copyright (c) 2005-2010 Code Synthesis Tools CC +// license : MIT; see accompanying LICENSE file + +#ifndef CUTL_DETAILS_EXPORT_HXX +#define CUTL_DETAILS_EXPORT_HXX + +#include + +#ifdef LIBCUTL_STATIC_LIB +# define LIBCUTL_EXPORT +#else +# ifdef _WIN32 +# ifdef _MSC_VER +# ifdef LIBCUTL_DYNAMIC_LIB +# define LIBCUTL_EXPORT __declspec(dllexport) +# else +# define LIBCUTL_EXPORT __declspec(dllimport) +# endif +# else +# ifdef LIBCUTL_DYNAMIC_LIB +# ifdef DLL_EXPORT +# define LIBCUTL_EXPORT __declspec(dllexport) +# else +# define LIBCUTL_EXPORT +# endif +# else +# define LIBCUTL_EXPORT __declspec(dllimport) +# endif +# endif +# else +# define LIBCUTL_EXPORT +# endif +#endif + +#endif // CUTL_DETAILS_EXPORT_HXX diff --git a/cutl/exception.hxx b/cutl/exception.hxx index e8e12b4..228a7ad 100644 --- a/cutl/exception.hxx +++ b/cutl/exception.hxx @@ -8,9 +8,11 @@ #include +#include + namespace cutl { - struct exception: std::exception + struct LIBCUTL_EXPORT exception: std::exception { // By default return the exception type name ( typeid (*this).name () ). // diff --git a/cutl/fs/auto-remove.hxx b/cutl/fs/auto-remove.hxx index bf2b701..c30a630 100644 --- a/cutl/fs/auto-remove.hxx +++ b/cutl/fs/auto-remove.hxx @@ -11,13 +11,15 @@ #include #include +#include + namespace cutl { namespace fs { // Remove a file or an empty directory on destruction unless canceled. // - struct auto_remove + struct LIBCUTL_EXPORT auto_remove { explicit auto_remove (path const& p) @@ -47,7 +49,7 @@ namespace cutl // Remove a list of file or aempty directories on destruction unless // canceled. // - struct auto_removes + struct LIBCUTL_EXPORT auto_removes { auto_removes () {} ~auto_removes (); diff --git a/cutl/fs/exception.hxx b/cutl/fs/exception.hxx index f00dadb..d238a73 100644 --- a/cutl/fs/exception.hxx +++ b/cutl/fs/exception.hxx @@ -12,7 +12,7 @@ namespace cutl { namespace fs { - struct error: exception + struct LIBCUTL_EXPORT error: exception { error (int code): code_ (code) {} diff --git a/cutl/fs/path.hxx b/cutl/fs/path.hxx index fbf179e..9fed07a 100644 --- a/cutl/fs/path.hxx +++ b/cutl/fs/path.hxx @@ -11,6 +11,8 @@ #include +#include + namespace cutl { namespace fs @@ -86,7 +88,7 @@ namespace cutl // // - class invalid_path_base: exception + class LIBCUTL_EXPORT invalid_path_base: exception { public: virtual char const* diff --git a/cutl/libcutl-vc10.vcxproj b/cutl/libcutl-vc10.vcxproj new file mode 100644 index 0000000..573d60a --- /dev/null +++ b/cutl/libcutl-vc10.vcxproj @@ -0,0 +1,170 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {A3903F70-CC9F-4D1C-9793-221EAE08DBB5} + Win32Proj + libcutl + + + + DynamicLibrary + true + Unicode + + + DynamicLibrary + true + Unicode + + + DynamicLibrary + false + true + Unicode + + + DynamicLibrary + false + true + Unicode + + + + + + + + + + + + + + + + + + + true + ..\bin\ + cutl-d-__value__(interface_version)-vc10 + + + true + ..\bin64\ + cutl-d-__value__(interface_version)-vc10 + + + false + ..\bin\ + cutl-__value__(interface_version)-vc10 + + + false + ..\bin64\ + cutl-__value__(interface_version)-vc10 + + + + + + Level3 + Disabled + WIN32;_DEBUG;_WINDOWS;_USRDLL;LIBCUTL_DYNAMIC_LIB;%(PreprocessorDefinitions) + .. + 4355;4800;4290;4251;%(DisableSpecificWarnings) + + + Windows + true + $(TargetPath) + ..\lib\cutl-d.lib + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_WINDOWS;_USRDLL;LIBCUTL_DYNAMIC_LIB;%(PreprocessorDefinitions) + .. + 4355;4800;4290;4251;%(DisableSpecificWarnings) + + + Windows + true + $(TargetPath) + ..\lib64\cutl-d.lib + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBCUTL_DYNAMIC_LIB;%(PreprocessorDefinitions) + .. + 4355;4800;4290;4251;%(DisableSpecificWarnings) + + + Windows + true + true + true + $(TargetPath) + ..\lib\cutl.lib + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBCUTL_DYNAMIC_LIB;%(PreprocessorDefinitions) + .. + 4355;4800;4290;4251;%(DisableSpecificWarnings) + + + Windows + true + true + true + $(TargetPath) + ..\lib64\cutl.lib + + + +__header_entries__(headers) + + +__source_entries__(sources) + + + + + diff --git a/cutl/libcutl-vc10.vcxproj.filters b/cutl/libcutl-vc10.vcxproj.filters new file mode 100644 index 0000000..641661b --- /dev/null +++ b/cutl/libcutl-vc10.vcxproj.filters @@ -0,0 +1,19 @@ + + + + + {A4EE4929-6BF6-4B45-8BF1-3187A81F096E} + cxx + + + {D965C189-96AF-4E9F-9C05-D815464A588F} + h;hxx;ixx;txx + + + +__header_filter_entries__(headers) + + +__source_filter_entries__(sources) + + diff --git a/cutl/libcutl-vc9.vcproj b/cutl/libcutl-vc9.vcproj new file mode 100644 index 0000000..474112f --- /dev/null +++ b/cutl/libcutl-vc9.vcproj @@ -0,0 +1,355 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +__source_entries__(sources) + + +__file_entries__(headers) + + + + + diff --git a/cutl/makefile b/cutl/makefile index 137da68..efc4301 100644 --- a/cutl/makefile +++ b/cutl/makefile @@ -21,6 +21,7 @@ cutl.l := $(out_base)/cutl.l cutl.l.cpp-options := $(out_base)/cutl.l.cpp-options default := $(out_base)/ +dist := $(out_base)/.dist install := $(out_base)/.install clean := $(out_base)/.clean @@ -30,21 +31,49 @@ clean := $(out_base)/.clean $(cutl.l): $(cxx_obj) $(cxx_obj) $(cxx_od): $(cutl.l.cpp-options) -$(cutl.l.cpp-options): value := -I$(src_root) +$(cutl.l.cpp-options): value := -I$(out_root) -I$(src_root) +$(cxx_obj) $(cxx_od): $(odb_tracer.l.cpp-options) $(out_base)/details/config.h -$(call include-dep,$(cxx_od)) +$(out_base)/details/config.h: + @echo '// file : cutl/details/config.h' >$@ + @echo '// author : automatically generated' >>$@ + @echo '' >>$@ + @echo '#ifndef CUTL_DETAILS_CONFIG_H' >>$@ + @echo '#define CUTL_DETAILS_CONFIG_H' >>$@ + @echo '' >>$@ + @echo '' >>$@ + @echo '#endif // CUTL_DETAILS_CONFIG_H' >>$@ +$(call include-dep,$(cxx_od),$(cxx_obj),$(out_base)/details/config.h) # Convenience alias for default target. # $(out_base)/: $(cutl.l) +# Dist. +# +$(dist): export sources := $(cxx_tun) +$(dist): export headers = $(subst $(src_base)/,,$(shell find $(src_base) \ +-name '*.hxx' -o -name '*.ixx' -o -name '*.txx')) +$(dist): export extra_dist := libcutl-vc9.vcproj libcutl-vc10.vcxproj \ +libcutl-vc10.vcxproj.filters +$(dist): export interface_version = $(shell sed -e \ +'s/^\([0-9]*\.[0-9]*\).*/\1/' $(src_root)/version) + +$(dist): + $(call dist-data,$(sources) $(headers) details/config.h.in) + $(call meta-vc9proj,libcutl-vc9.vcproj) + $(call meta-vc10proj,libcutl-vc10.vcxproj) + $(call meta-automake) + # Install. # $(install): $(cutl.l) $(call install-lib,$<,$(install_lib_dir)/$(ld_lib_prefix)cutl$(ld_lib_suffix)) $(call install-dir,$(src_base),$(install_inc_dir)/cutl,\ '(' -name '*.hxx' -o -name '*.ixx' -o -name '*.txx' ')') + $(call install-data,$(out_base)/details/config.h,\ +$(install_inc_dir)/cutl/details/config.h) # Clean. # @@ -52,10 +81,27 @@ $(clean): $(cutl.l).o.clean \ $(cutl.l.cpp-options).clean \ $(addsuffix .cxx.clean,$(cxx_obj)) \ $(addsuffix .cxx.clean,$(cxx_od)) + $(call message,rm $$1,rm -f $$1,$(out_base)/details/config.h) + +# Generated .gitignore. +# +ifeq ($(out_base),$(src_base)) +$(cutl.l): | $(out_base)/.gitignore + +$(out_base)/.gitignore: files := details/config.h +$(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)/install.make) +$(call include,$(bld_root)/meta/vc9proj.make) +$(call include,$(bld_root)/meta/vc10proj.make) +$(call include,$(bld_root)/meta/automake.make) + $(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/cutl/shared-ptr/base.hxx b/cutl/shared-ptr/base.hxx index 0a631d4..50e54d4 100644 --- a/cutl/shared-ptr/base.hxx +++ b/cutl/shared-ptr/base.hxx @@ -11,9 +11,11 @@ #include +#include + namespace cutl { - struct share + struct LIBCUTL_EXPORT share { explicit share (char id); @@ -26,24 +28,24 @@ namespace cutl }; } -extern cutl::share shared; -extern cutl::share exclusive; +extern LIBCUTL_EXPORT cutl::share shared; +extern LIBCUTL_EXPORT cutl::share exclusive; -void* +LIBCUTL_EXPORT void* operator new (std::size_t, cutl::share) throw (std::bad_alloc); -void +LIBCUTL_EXPORT void operator delete (void*, cutl::share) throw (); namespace cutl { - struct not_shared: exception + struct LIBCUTL_EXPORT not_shared: exception { virtual char const* what () const throw (); }; - struct shared_base + struct LIBCUTL_EXPORT shared_base { shared_base (); shared_base (shared_base const&); -- cgit v1.1