diff options
36 files changed, 998 insertions, 516 deletions
diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 0000000..de949c6 --- /dev/null +++ b/Makefile.am @@ -0,0 +1,12 @@ +# file : Makefile.am +# author : Boris Kolpackov <boris@codesynthesis.com> +# copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +# license : MIT; see accompanying LICENSE file + +SUBDIRS = __path__(dirs) +dist_doc_DATA = __file__(docs) +EXTRA_DIST = __file__(extra_dist) +ACLOCAL_AMFLAGS = -I m4 + +pkgconfigdir = @pkgconfigdir@ +pkgconfig_DATA= libcutl.pc @@ -1,3 +1,7 @@ @@ Add memprof? -@@ path::base() and ".." & "." special directories +@@ path::base() and ".." & "." special directories. +@@ INSTALL does not describe automake/vc++ (not currently dist'ed). +@@ Add static lib vc++ configurations (for cli). +@@ Handle tests in automake. + diff --git a/bootstrap b/bootstrap new file mode 100755 index 0000000..611e838 --- /dev/null +++ b/bootstrap @@ -0,0 +1,18 @@ +#! /bin/sh + +# file : bootstrap +# author : Boris Kolpackov <boris@codesynthesis.com> +# copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +# license : MIT; see accompanying LICENSE file + +# +# Bootstrap the automake build system. +# + +rm -f config.cache + +if test ! -d m4; then + mkdir m4 +fi + +autoreconf --install diff --git a/build/bootstrap.make b/build/bootstrap.make index 7d34526..6c742dd 100644 --- a/build/bootstrap.make +++ b/build/bootstrap.make @@ -21,29 +21,54 @@ endif # .PHONY: $(out_base)/ \ $(out_base)/.test \ + $(out_base)/.dist \ $(out_base)/.install \ $(out_base)/.clean ifdef %interactive% -.PHONY: test install clean +.PHONY: test dist install clean test: $(out_base)/.test +dist: $(out_base)/.dist install: $(out_base)/.install clean: $(out_base)/.clean -ifneq ($(filter $(.DEFAULT_GOAL),test install clean),) +ifneq ($(filter $(.DEFAULT_GOAL),test dist install clean),) .DEFAULT_GOAL := endif endif -# Don't include dependency info for certain targets. +# Make sure the distribution prefix is set if the goal is dist. # +ifneq ($(filter $(MAKECMDGOALS),dist),) +ifeq ($(dist_prefix),) +$(error dist_prefix is not set) +endif +endif + +# If we don't have dependency auto-generation then we need to manually +# make sure that generated files are generated before C++ file are +# compiler. To do this we make the object files ($2) depend in order- +# only on generated files ($3). +# +ifeq ($(cxx_id),generic) + +define include-dep +$(if $2,$(eval $2: | $3)) +endef + +else + define include-dep $(call -include,$1) endef -ifneq ($(filter $(MAKECMDGOALS),clean disfigure),) +endif + +# Don't include dependency info for certain targets. +# +ifneq ($(filter $(MAKECMDGOALS),clean disfigure dist),) include-dep = endif diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000..e45f845 --- /dev/null +++ b/configure.ac @@ -0,0 +1,41 @@ +# file : configure.ac +# author : Boris Kolpackov <boris@codesynthesis.com> +# copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +# license : MIT; see accompanying LICENSE file + +AC_PREREQ(2.60) +AC_INIT([libcutl], [__value__(version)], [libcutl-users@codesynthesis.com]) +AC_CONFIG_AUX_DIR([config]) +AC_CONFIG_MACRO_DIR([m4]) +AC_CONFIG_SRCDIR([cutl/exception.hxx]) + +AM_INIT_AUTOMAKE([-Wall -Werror foreign nostdinc subdir-objects dist-bzip2 dist-zip tar-ustar]) + +LT_INIT([win32-dll]) + +AC_CANONICAL_HOST + +# Check for C++ compiler and use it to compile the tests. +# +AC_PROG_CXX +AC_LANG(C++) + +# Create the libtool executable so that we can use it in further tests. +# +LT_OUTPUT + +# Allow the user to specify the pkgconfig directory. +# +PKGCONFIG + +# Check if we should disable rpath. +# +DISABLE_RPATH + +# Output. +# +AC_CONFIG_HEADERS([cutl/config.h cutl/details/config.h]) +AC_CONFIG_FILES([ + __path__(config_files) +]) +AC_OUTPUT 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 <boris@codesynthesis.com> +# 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 <cutl/exception.hxx> #include <cutl/container/any.hxx> +#include <cutl/details/export.hxx> + 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 <typeinfo> // std::type_info +#include <cutl/details/export.hxx> + namespace cutl { namespace compiler { - class type_id + class LIBCUTL_EXPORT type_id { public: template<typename X> 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 <cutl/static-ptr.hxx> #include <cutl/compiler/type-id.hxx> +#include <cutl/details/export.hxx> + 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<base_info> 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 <typename X> @@ -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 <cutl/exception.hxx> +#include <cutl/details/export.hxx> + namespace cutl { namespace container { - class any + class LIBCUTL_EXPORT any { public: - struct typing: exception {}; + struct LIBCUTL_EXPORT typing: exception {}; public: template <typename X> @@ -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 <cutl/exception.hxx> #include <cutl/shared-ptr.hxx> +#include <cutl/details/export.hxx> + 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 <typename N, typename E> 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 @@ -<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="8.00"
- Name="cutl"
- ProjectGUID="{162AFFCF-ABD2-46F3-97A8-642F1256D8B5}"
- RootNamespace="cutl"
- Keyword="Win32Proj"
- >
- <Platforms>
- <Platform
- Name="Win32"
- />
- </Platforms>
- <ToolFiles>
- </ToolFiles>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="$(SolutionDir)$(ConfigurationName)"
- IntermediateDirectory="$(ConfigurationName)"
- ConfigurationType="4"
- CharacterSet="1"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- AdditionalOptions="/wd4800 /wd4290"
- Optimization="0"
- AdditionalIncludeDirectories=".."
- MinimalRebuild="true"
- BasicRuntimeChecks="3"
- RuntimeLibrary="1"
- UsePrecompiledHeader="0"
- WarningLevel="3"
- Detect64BitPortabilityProblems="true"
- DebugInformationFormat="4"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLibrarianTool"
- OutputFile="$(ProjectName).lib"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="$(SolutionDir)$(ConfigurationName)"
- IntermediateDirectory="$(ConfigurationName)"
- ConfigurationType="4"
- CharacterSet="1"
- WholeProgramOptimization="1"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- AdditionalOptions="/wd4800 /wd4290"
- AdditionalIncludeDirectories=".."
- PreprocessorDefinitions="-I."
- RuntimeLibrary="0"
- UsePrecompiledHeader="0"
- WarningLevel="3"
- Detect64BitPortabilityProblems="true"
- DebugInformationFormat="3"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLibrarianTool"
- OutputFile="$(ProjectName).lib"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- </Configurations>
- <References>
- </References>
- <Files>
- <Filter
- Name="Source Files"
- Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
- UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
- >
- <File
- RelativePath=".\fs\auto-remove.cxx"
- >
- </File>
- <File
- RelativePath=".\shared-ptr\base.cxx"
- >
- </File>
- <File
- RelativePath=".\compiler\context.cxx"
- >
- </File>
- <File
- RelativePath=".\compiler\cxx-indenter.cxx"
- >
- </File>
- <File
- RelativePath=".\fs\exception.cxx"
- >
- <FileConfiguration
- Name="Debug|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- ObjectFile="$(IntDir)\$(InputName)1.obj"
- XMLDocumentationFileName="$(IntDir)\$(InputName)1.xdc"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- ObjectFile="$(IntDir)\$(InputName)1.obj"
- XMLDocumentationFileName="$(IntDir)\$(InputName)1.xdc"
- />
- </FileConfiguration>
- </File>
- <File
- RelativePath=".\exception.cxx"
- >
- </File>
- <File
- RelativePath=".\fs\path.cxx"
- >
- </File>
- <File
- RelativePath=".\compiler\type-info.cxx"
- >
- </File>
- </Filter>
- <Filter
- Name="Header Files"
- Filter="h;hpp;hxx;hm;inl;inc;xsd"
- UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
- >
- </Filter>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
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 @@ -<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="9.00"
- Name="cutl"
- ProjectGUID="{630FA2F0-018B-463D-A56C-59EC72CC6521}"
- RootNamespace="cutl"
- Keyword="Win32Proj"
- TargetFrameworkVersion="196613"
- >
- <Platforms>
- <Platform
- Name="Win32"
- />
- </Platforms>
- <ToolFiles>
- </ToolFiles>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="$(SolutionDir)$(ConfigurationName)"
- IntermediateDirectory="$(ConfigurationName)"
- ConfigurationType="4"
- CharacterSet="1"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- AdditionalOptions="/wd4800 /wd4290"
- Optimization="0"
- AdditionalIncludeDirectories=".."
- PreprocessorDefinitions="WIN32;_DEBUG;_LIB"
- MinimalRebuild="true"
- BasicRuntimeChecks="3"
- RuntimeLibrary="1"
- UsePrecompiledHeader="0"
- WarningLevel="3"
- DebugInformationFormat="4"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLibrarianTool"
- OutputFile="$(ProjectName).lib"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="$(SolutionDir)$(ConfigurationName)"
- IntermediateDirectory="$(ConfigurationName)"
- ConfigurationType="4"
- CharacterSet="1"
- WholeProgramOptimization="1"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- AdditionalOptions="/wd4800 /wd4290"
- Optimization="2"
- EnableIntrinsicFunctions="true"
- AdditionalIncludeDirectories=".."
- PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
- RuntimeLibrary="0"
- EnableFunctionLevelLinking="true"
- UsePrecompiledHeader="0"
- WarningLevel="3"
- DebugInformationFormat="3"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLibrarianTool"
- OutputFile="$(ProjectName).lib"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- </Configurations>
- <References>
- </References>
- <Files>
- <Filter
- Name="Source Files"
- Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
- UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
- >
- <File
- RelativePath=".\fs\auto-remove.cxx"
- >
- </File>
- <File
- RelativePath=".\shared-ptr\base.cxx"
- >
- </File>
- <File
- RelativePath=".\compiler\context.cxx"
- >
- </File>
- <File
- RelativePath=".\compiler\cxx-indenter.cxx"
- >
- </File>
- <File
- RelativePath=".\exception.cxx"
- >
- </File>
- <File
- RelativePath=".\fs\exception.cxx"
- >
- <FileConfiguration
- Name="Debug|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- ObjectFile="$(IntDir)\exception-fs.obj"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- ObjectFile="$(IntDir)\exception-fs.obj"
- />
- </FileConfiguration>
- </File>
- <File
- RelativePath=".\fs\path.cxx"
- >
- </File>
- <File
- RelativePath=".\compiler\type-info.cxx"
- >
- </File>
- </Filter>
- <Filter
- Name="Header Files"
- Filter="h;hpp;hxx;hm;inl;inc;xsd"
- UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
- >
- </Filter>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
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 <boris@codesynthesis.com> + * 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 <boris@codesynthesis.com> +// 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 <cutl/details/config.h> +#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 <boris@codesynthesis.com> +// 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 <cutl/details/config.hxx> + +#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 <exception> +#include <cutl/details/export.hxx> + 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 <cutl/fs/path.hxx> #include <cutl/fs/exception.hxx> +#include <cutl/details/export.hxx> + 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 <cutl/exception.hxx> +#include <cutl/details/export.hxx> + 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 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup Label="ProjectConfigurations"> + <ProjectConfiguration Include="Debug|Win32"> + <Configuration>Debug</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Debug|x64"> + <Configuration>Debug</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|Win32"> + <Configuration>Release</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|x64"> + <Configuration>Release</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + </ItemGroup> + <PropertyGroup Label="Globals"> + <ProjectGuid>{A3903F70-CC9F-4D1C-9793-221EAE08DBB5}</ProjectGuid> + <Keyword>Win32Proj</Keyword> + <RootNamespace>libcutl</RootNamespace> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> + <ConfigurationType>DynamicLibrary</ConfigurationType> + <UseDebugLibraries>true</UseDebugLibraries> + <CharacterSet>Unicode</CharacterSet> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> + <ConfigurationType>DynamicLibrary</ConfigurationType> + <UseDebugLibraries>true</UseDebugLibraries> + <CharacterSet>Unicode</CharacterSet> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> + <ConfigurationType>DynamicLibrary</ConfigurationType> + <UseDebugLibraries>false</UseDebugLibraries> + <WholeProgramOptimization>true</WholeProgramOptimization> + <CharacterSet>Unicode</CharacterSet> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> + <ConfigurationType>DynamicLibrary</ConfigurationType> + <UseDebugLibraries>false</UseDebugLibraries> + <WholeProgramOptimization>true</WholeProgramOptimization> + <CharacterSet>Unicode</CharacterSet> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> + <ImportGroup Label="ExtensionSettings"> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <PropertyGroup Label="UserMacros" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <LinkIncremental>true</LinkIncremental> + <OutDir>..\bin\</OutDir> + <TargetName>cutl-d-__value__(interface_version)-vc10</TargetName> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <LinkIncremental>true</LinkIncremental> + <OutDir>..\bin64\</OutDir> + <TargetName>cutl-d-__value__(interface_version)-vc10</TargetName> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <LinkIncremental>false</LinkIncremental> + <OutDir>..\bin\</OutDir> + <TargetName>cutl-__value__(interface_version)-vc10</TargetName> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + <LinkIncremental>false</LinkIncremental> + <OutDir>..\bin64\</OutDir> + <TargetName>cutl-__value__(interface_version)-vc10</TargetName> + </PropertyGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <ClCompile> + <PrecompiledHeader> + </PrecompiledHeader> + <WarningLevel>Level3</WarningLevel> + <Optimization>Disabled</Optimization> + <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;LIBCUTL_DYNAMIC_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <AdditionalIncludeDirectories>..</AdditionalIncludeDirectories> + <DisableSpecificWarnings>4355;4800;4290;4251;%(DisableSpecificWarnings)</DisableSpecificWarnings> + </ClCompile> + <Link> + <SubSystem>Windows</SubSystem> + <GenerateDebugInformation>true</GenerateDebugInformation> + <OutputFile>$(TargetPath)</OutputFile> + <ImportLibrary>..\lib\cutl-d.lib</ImportLibrary> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <ClCompile> + <PrecompiledHeader> + </PrecompiledHeader> + <WarningLevel>Level3</WarningLevel> + <Optimization>Disabled</Optimization> + <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;LIBCUTL_DYNAMIC_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <AdditionalIncludeDirectories>..</AdditionalIncludeDirectories> + <DisableSpecificWarnings>4355;4800;4290;4251;%(DisableSpecificWarnings)</DisableSpecificWarnings> + </ClCompile> + <Link> + <SubSystem>Windows</SubSystem> + <GenerateDebugInformation>true</GenerateDebugInformation> + <OutputFile>$(TargetPath)</OutputFile> + <ImportLibrary>..\lib64\cutl-d.lib</ImportLibrary> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <ClCompile> + <WarningLevel>Level3</WarningLevel> + <PrecompiledHeader> + </PrecompiledHeader> + <Optimization>MaxSpeed</Optimization> + <FunctionLevelLinking>true</FunctionLevelLinking> + <IntrinsicFunctions>true</IntrinsicFunctions> + <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBCUTL_DYNAMIC_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <AdditionalIncludeDirectories>..</AdditionalIncludeDirectories> + <DisableSpecificWarnings>4355;4800;4290;4251;%(DisableSpecificWarnings)</DisableSpecificWarnings> + </ClCompile> + <Link> + <SubSystem>Windows</SubSystem> + <GenerateDebugInformation>true</GenerateDebugInformation> + <EnableCOMDATFolding>true</EnableCOMDATFolding> + <OptimizeReferences>true</OptimizeReferences> + <OutputFile>$(TargetPath)</OutputFile> + <ImportLibrary>..\lib\cutl.lib</ImportLibrary> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + <ClCompile> + <WarningLevel>Level3</WarningLevel> + <PrecompiledHeader> + </PrecompiledHeader> + <Optimization>MaxSpeed</Optimization> + <FunctionLevelLinking>true</FunctionLevelLinking> + <IntrinsicFunctions>true</IntrinsicFunctions> + <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBCUTL_DYNAMIC_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <AdditionalIncludeDirectories>..</AdditionalIncludeDirectories> + <DisableSpecificWarnings>4355;4800;4290;4251;%(DisableSpecificWarnings)</DisableSpecificWarnings> + </ClCompile> + <Link> + <SubSystem>Windows</SubSystem> + <GenerateDebugInformation>true</GenerateDebugInformation> + <EnableCOMDATFolding>true</EnableCOMDATFolding> + <OptimizeReferences>true</OptimizeReferences> + <OutputFile>$(TargetPath)</OutputFile> + <ImportLibrary>..\lib64\cutl.lib</ImportLibrary> + </Link> + </ItemDefinitionGroup> + <ItemGroup> +__header_entries__(headers) + </ItemGroup> + <ItemGroup> +__source_entries__(sources) + </ItemGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> + <ImportGroup Label="ExtensionTargets"> + </ImportGroup> +</Project> 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 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup> + <Filter Include="Source Files"> + <UniqueIdentifier>{A4EE4929-6BF6-4B45-8BF1-3187A81F096E}</UniqueIdentifier> + <Extensions>cxx</Extensions> + </Filter> + <Filter Include="Header Files"> + <UniqueIdentifier>{D965C189-96AF-4E9F-9C05-D815464A588F}</UniqueIdentifier> + <Extensions>h;hxx;ixx;txx</Extensions> + </Filter> + </ItemGroup> + <ItemGroup> +__header_filter_entries__(headers) + </ItemGroup> + <ItemGroup> +__source_filter_entries__(sources) + </ItemGroup> +</Project> 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 @@ +<?xml version="1.0" encoding="Windows-1252"?> +<VisualStudioProject + ProjectType="Visual C++" + Version="9.00" + Name="libcutl" + ProjectGUID="{E12E5299-8AFB-43F3-832F-9919A26C4F9C}" + RootNamespace="libcutl" + Keyword="Win32Proj" + TargetFrameworkVersion="196613" + > + <Platforms> + <Platform + Name="Win32" + /> + <Platform + Name="x64" + /> + </Platforms> + <ToolFiles> + </ToolFiles> + <Configurations> + <Configuration + Name="Debug|Win32" + OutputDirectory=".." + IntermediateDirectory="$(ConfigurationName)" + ConfigurationType="2" + CharacterSet="1" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + AdditionalOptions="/wd4355 /wd4800 /wd4290 /wd4251" + Optimization="0" + AdditionalIncludeDirectories=".." + PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;LIBCUTL_DYNAMIC_LIB" + MinimalRebuild="true" + BasicRuntimeChecks="3" + RuntimeLibrary="3" + UsePrecompiledHeader="0" + WarningLevel="3" + DebugInformationFormat="4" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + /> + <Tool + Name="VCPreLinkEventTool" + CommandLine="if not exist ..\lib mkdir ..\lib" + /> + <Tool + Name="VCLinkerTool" + OutputFile="$(OutDir)\bin\cutl-d-__value__(interface_version)-vc9.dll" + LinkIncremental="2" + GenerateDebugInformation="true" + SubSystem="2" + ImportLibrary="$(OutDir)\lib\cutl-d.lib" + TargetMachine="1" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCManifestTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCAppVerifierTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + </Configuration> + <Configuration + Name="Debug|x64" + OutputDirectory=".." + IntermediateDirectory="$(PlatformName)\$(ConfigurationName)" + ConfigurationType="2" + CharacterSet="1" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + TargetEnvironment="3" + /> + <Tool + Name="VCCLCompilerTool" + AdditionalOptions="/wd4355 /wd4800 /wd4290 /wd4251" + Optimization="0" + AdditionalIncludeDirectories=".." + PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;LIBCUTL_DYNAMIC_LIB" + MinimalRebuild="true" + BasicRuntimeChecks="3" + RuntimeLibrary="3" + UsePrecompiledHeader="0" + WarningLevel="3" + DebugInformationFormat="3" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + /> + <Tool + Name="VCPreLinkEventTool" + CommandLine="if not exist ..\lib64 mkdir ..\lib64" + /> + <Tool + Name="VCLinkerTool" + OutputFile="$(OutDir)\bin64\cutl-d-__value__(interface_version)-vc9.dll" + LinkIncremental="2" + GenerateDebugInformation="true" + SubSystem="2" + ImportLibrary="$(OutDir)\lib64\cutl-d.lib" + TargetMachine="17" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCManifestTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCAppVerifierTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + </Configuration> + <Configuration + Name="Release|Win32" + OutputDirectory=".." + IntermediateDirectory="$(ConfigurationName)" + ConfigurationType="2" + CharacterSet="1" + WholeProgramOptimization="1" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + /> + <Tool + Name="VCCLCompilerTool" + AdditionalOptions="/wd4355 /wd4800 /wd4290 /wd4251" + Optimization="2" + EnableIntrinsicFunctions="true" + AdditionalIncludeDirectories=".." + PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBCUTL_DYNAMIC_LIB" + RuntimeLibrary="2" + EnableFunctionLevelLinking="true" + UsePrecompiledHeader="0" + WarningLevel="3" + DebugInformationFormat="3" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + /> + <Tool + Name="VCPreLinkEventTool" + CommandLine="if not exist ..\lib mkdir ..\lib" + /> + <Tool + Name="VCLinkerTool" + OutputFile="$(OutDir)\bin\cutl-__value__(interface_version)-vc9.dll" + LinkIncremental="1" + GenerateDebugInformation="true" + SubSystem="2" + OptimizeReferences="2" + EnableCOMDATFolding="2" + ImportLibrary="$(OutDir)\lib\cutl.lib" + TargetMachine="1" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCManifestTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCAppVerifierTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + </Configuration> + <Configuration + Name="Release|x64" + OutputDirectory=".." + IntermediateDirectory="$(PlatformName)\$(ConfigurationName)" + ConfigurationType="2" + CharacterSet="1" + WholeProgramOptimization="1" + > + <Tool + Name="VCPreBuildEventTool" + /> + <Tool + Name="VCCustomBuildTool" + /> + <Tool + Name="VCXMLDataGeneratorTool" + /> + <Tool + Name="VCWebServiceProxyGeneratorTool" + /> + <Tool + Name="VCMIDLTool" + TargetEnvironment="3" + /> + <Tool + Name="VCCLCompilerTool" + AdditionalOptions="/wd4355 /wd4800 /wd4290 /wd4251" + Optimization="2" + EnableIntrinsicFunctions="true" + AdditionalIncludeDirectories=".." + PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBCUTL_DYNAMIC_LIB" + RuntimeLibrary="2" + EnableFunctionLevelLinking="true" + UsePrecompiledHeader="0" + WarningLevel="3" + DebugInformationFormat="3" + /> + <Tool + Name="VCManagedResourceCompilerTool" + /> + <Tool + Name="VCResourceCompilerTool" + /> + <Tool + Name="VCPreLinkEventTool" + CommandLine="if not exist ..\lib64 mkdir ..\lib64" + /> + <Tool + Name="VCLinkerTool" + OutputFile="$(OutDir)\bin64\cutl-__value__(interface_version)-vc9.dll" + LinkIncremental="1" + GenerateDebugInformation="true" + SubSystem="2" + OptimizeReferences="2" + EnableCOMDATFolding="2" + ImportLibrary="$(OutDir)\lib64\cutl.lib" + TargetMachine="17" + /> + <Tool + Name="VCALinkTool" + /> + <Tool + Name="VCManifestTool" + /> + <Tool + Name="VCXDCMakeTool" + /> + <Tool + Name="VCBscMakeTool" + /> + <Tool + Name="VCFxCopTool" + /> + <Tool + Name="VCAppVerifierTool" + /> + <Tool + Name="VCPostBuildEventTool" + /> + </Configuration> + </Configurations> + <References> + </References> + <Files> + <Filter + Name="Source Files" + Filter="cxx" + UniqueIdentifier="{08953974-D0EB-4BDD-B84E-F78FBE580362}" + > +__source_entries__(sources) + </Filter> + <Filter + Name="Header Files" + Filter="h;hxx;ixx;txx" + UniqueIdentifier="{A8A5593E-EED1-407F-BA73-490CD9747712}" + > +__file_entries__(headers) + </Filter> + </Files> + <Globals> + </Globals> +</VisualStudioProject> 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 <cutl/exception.hxx> +#include <cutl/details/export.hxx> + 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&); diff --git a/libcutl-vc10.sln b/libcutl-vc10.sln new file mode 100644 index 0000000..d28c0b2 --- /dev/null +++ b/libcutl-vc10.sln @@ -0,0 +1,26 @@ +
+Microsoft Visual Studio Solution File, Format Version 11.00
+# Visual Studio 2010
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcutl", "cutl\libcutl-vc10.vcxproj", "{A3903F70-CC9F-4D1C-9793-221EAE08DBB5}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Win32 = Debug|Win32
+ Debug|x64 = Debug|x64
+ Release|Win32 = Release|Win32
+ Release|x64 = Release|x64
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {A3903F70-CC9F-4D1C-9793-221EAE08DBB5}.Debug|Win32.ActiveCfg = Debug|Win32
+ {A3903F70-CC9F-4D1C-9793-221EAE08DBB5}.Debug|Win32.Build.0 = Debug|Win32
+ {A3903F70-CC9F-4D1C-9793-221EAE08DBB5}.Debug|x64.ActiveCfg = Debug|x64
+ {A3903F70-CC9F-4D1C-9793-221EAE08DBB5}.Debug|x64.Build.0 = Debug|x64
+ {A3903F70-CC9F-4D1C-9793-221EAE08DBB5}.Release|Win32.ActiveCfg = Release|Win32
+ {A3903F70-CC9F-4D1C-9793-221EAE08DBB5}.Release|Win32.Build.0 = Release|Win32
+ {A3903F70-CC9F-4D1C-9793-221EAE08DBB5}.Release|x64.ActiveCfg = Release|x64
+ {A3903F70-CC9F-4D1C-9793-221EAE08DBB5}.Release|x64.Build.0 = Release|x64
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/libcutl-vc9.sln b/libcutl-vc9.sln new file mode 100644 index 0000000..164db43 --- /dev/null +++ b/libcutl-vc9.sln @@ -0,0 +1,26 @@ +
+Microsoft Visual Studio Solution File, Format Version 10.00
+# Visual Studio 2008
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcutl", "cutl\libcutl-vc9.vcproj", "{E12E5299-8AFB-43F3-832F-9919A26C4F9C}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Win32 = Debug|Win32
+ Debug|x64 = Debug|x64
+ Release|Win32 = Release|Win32
+ Release|x64 = Release|x64
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {E12E5299-8AFB-43F3-832F-9919A26C4F9C}.Debug|Win32.ActiveCfg = Debug|Win32
+ {E12E5299-8AFB-43F3-832F-9919A26C4F9C}.Debug|Win32.Build.0 = Debug|Win32
+ {E12E5299-8AFB-43F3-832F-9919A26C4F9C}.Debug|x64.ActiveCfg = Debug|x64
+ {E12E5299-8AFB-43F3-832F-9919A26C4F9C}.Debug|x64.Build.0 = Debug|x64
+ {E12E5299-8AFB-43F3-832F-9919A26C4F9C}.Release|Win32.ActiveCfg = Release|Win32
+ {E12E5299-8AFB-43F3-832F-9919A26C4F9C}.Release|Win32.Build.0 = Release|Win32
+ {E12E5299-8AFB-43F3-832F-9919A26C4F9C}.Release|x64.ActiveCfg = Release|x64
+ {E12E5299-8AFB-43F3-832F-9919A26C4F9C}.Release|x64.Build.0 = Release|x64
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/libcutl.pc.in b/libcutl.pc.in new file mode 100644 index 0000000..be2e0d6 --- /dev/null +++ b/libcutl.pc.in @@ -0,0 +1,16 @@ +# file : libcutl.pc.in +# author : Boris Kolpackov <boris@codesynthesis.com> +# copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +# license : MIT; see accompanying LICENSE file + +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: libcutl +Description: C++ utility library +URL: http://www.codesynthesis.com/projects/libcutl/ +Version: @VERSION@ +Libs: -L${libdir} -lcutl +Cflags: -I${includedir} diff --git a/m4/disable-rpath.m4 b/m4/disable-rpath.m4 new file mode 100644 index 0000000..4540e66 --- /dev/null +++ b/m4/disable-rpath.m4 @@ -0,0 +1,26 @@ +dnl file : m4/disable-rpath.m4 +dnl author : Boris Kolpackov <boris@codesynthesis.com> +dnl copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +dnl license : MIT; see accompanying LICENSE file +dnl +AC_DEFUN([DISABLE_RPATH],[ + +AC_MSG_CHECKING([whether to use rpath]) +AC_ARG_ENABLE( + [rpath], + [AC_HELP_STRING([--disable-rpath], [patch libtool to not use rpath])], + [libtool_rpath="$enable_rpath"], + [libtool_rpath="yes"]) +AC_MSG_RESULT($libtool_rpath) + +# Patch libtool to not use rpath if requested. +# +AC_CONFIG_COMMANDS( + [libtool-rpath-patch], + [if test "$libtool_use_rpath" = "no"; then + sed < libtool > libtool-2 's/^hardcode_libdir_flag_spec.*$'/'hardcode_libdir_flag_spec=" -D__LIBTOOL_NO_RPATH__ "/' + mv libtool-2 libtool + chmod 755 libtool + fi], + [libtool_use_rpath=$libtool_rpath]) +])dnl diff --git a/m4/libtool-link.m4 b/m4/libtool-link.m4 new file mode 100644 index 0000000..4748520 --- /dev/null +++ b/m4/libtool-link.m4 @@ -0,0 +1,31 @@ +dnl file : m4/libtool-link.m4 +dnl author : Boris Kolpackov <boris@codesynthesis.com> +dnl copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +dnl license : MIT; see accompanying LICENSE file +dnl +dnl +dnl CXX_LIBTOOL_LINK_IFELSE (input, [action-if-true], [action-if-false]) +dnl +dnl Similar to AC_LINK_IFELSE except it uses libtool to perform the +dnl linking and it does this using the C++ compiler. +dnl +AC_DEFUN([CXX_LIBTOOL_LINK_IFELSE],[ +AC_LANG_SAVE +save_CXX="$CXX" +CXX="./libtool --tag=CXX --mode=link $CXX -no-install" +AC_LANG(C++) + +if test -d .libs; then + delete_libs_dir=no +else + delete_libs_dir=yes +fi + +AC_LINK_IFELSE([$1], [$2], [$3]) + +if test x"$delete_libs_dir" != xyes; then + rm -rf .libs +fi + +CXX="$save_CXX" +AC_LANG_RESTORE])dnl diff --git a/m4/pkgconfig.m4 b/m4/pkgconfig.m4 new file mode 100644 index 0000000..64d90f1 --- /dev/null +++ b/m4/pkgconfig.m4 @@ -0,0 +1,13 @@ +dnl file : m4/pkgconfig.m4 +dnl author : Boris Kolpackov <boris@codesynthesis.com> +dnl copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +dnl license : MIT; see accompanying LICENSE file +dnl +AC_DEFUN([PKGCONFIG],[ +AC_ARG_WITH( + [pkgconfigdir], + [AC_HELP_STRING([--with-pkgconfigdir=DIR],[location of pkgconfig dir (default is libdir/pkgconfig)])], + [pkgconfigdir=${withval}], + [pkgconfigdir='${libdir}/pkgconfig']) +AC_SUBST([pkgconfigdir]) +])dnl @@ -5,31 +5,41 @@ include $(dir $(lastword $(MAKEFILE_LIST)))build/bootstrap.make +dirs := cutl tests + default := $(out_base)/ test := $(out_base)/.test +dist := $(out_base)/.dist install := $(out_base)/.install clean := $(out_base)/.clean -# Build. -# -$(default): $(out_base)/cutl/ $(out_base)/tests/ +$(default): $(addprefix $(out_base)/,$(addsuffix /,$(dirs))) +$(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(dirs))) + +$(dist): export dirs := $(dirs) +$(dist): export docs := LICENSE NEWS README version +$(dist): data_dist := libcutl-vc9.sln libcutl-vc10.sln +$(dist): exec_dist := bootstrap +$(dist): export extra_dist := $(data_dist) $(exec_dist) +$(dist): export version = $(shell cat $(src_root)/version) -# Test. -# -$(test): $(out_base)/tests/.test +$(dist): $(addprefix $(out_base)/,$(addsuffix /.dist,$(dirs))) + $(call dist-data,$(docs) $(data_dist) libcutl.pc.in) + $(call dist-exec,$(exec_dist)) + $(call dist-dir,m4) + $(call meta-automake) + $(call meta-autoconf) -# Install. -# $(install): $(out_base)/cutl/.install $(call install-data,$(src_base)/LICENSE,$(install_doc_dir)/libcutl/LICENSE) $(call install-data,$(src_base)/NEWS,$(install_doc_dir)/libcutl/NEWS) $(call install-data,$(src_base)/README,$(install_doc_dir)/libcutl/README) -# Clean. -# -$(clean): $(out_base)/cutl/.clean $(out_base)/tests/.clean +$(clean): $(addprefix $(out_base)/,$(addsuffix /.clean,$(dirs))) +$(call include,$(bld_root)/dist.make) $(call include,$(bld_root)/install.make) +$(call include,$(bld_root)/meta/automake.make) +$(call include,$(bld_root)/meta/autoconf.make) -$(call import,$(src_base)/cutl/makefile) -$(call import,$(src_base)/tests/makefile) +$(foreach d,$(dirs),$(call import,$(src_base)/$d/makefile)) diff --git a/tests/Makefile.am b/tests/Makefile.am new file mode 100644 index 0000000..52ecabc --- /dev/null +++ b/tests/Makefile.am @@ -0,0 +1,6 @@ +# file : Makefile.am +# author : Boris Kolpackov <boris@codesynthesis.com> +# copyright : Copyright (c) 2009-2010 Code Synthesis Tools CC +# license : MIT; see accompanying LICENSE file + +SUBDIRS = __path__(dirs) diff --git a/tests/makefile b/tests/makefile index 20dd4ea..5b7bbf9 100644 --- a/tests/makefile +++ b/tests/makefile @@ -9,10 +9,19 @@ tests := compiler fs shared-ptr default := $(out_base)/ test := $(out_base)/.test +dist := $(out_base)/.dist clean := $(out_base)/.clean $(default): $(addprefix $(out_base)/,$(addsuffix /,$(tests))) $(test): $(addprefix $(out_base)/,$(addsuffix /.test,$(tests))) + +$(dist): export dirs := +$(dist): #$(addprefix $(out_base)/,$(addsuffix /.dist,$(tests))) + $(call meta-automake) + $(clean): $(addprefix $(out_base)/,$(addsuffix /.clean,$(tests))) +$(call include,$(bld_root)/dist.make) +$(call include,$(bld_root)/meta/automake.make) + $(foreach t,$(tests),$(call import,$(src_base)/$t/makefile)) |