From 1741b8e80e92135d80eaa2e22cf90b027034b58d Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 27 Dec 2011 16:18:55 +0200 Subject: Add support for using external boost in autotools build system --- cutl/Makefile.am | 4 ++++ cutl/details/config.h.in | 1 + cutl/makefile | 17 +++++++++-------- cutl/re/re.cxx | 6 +++++- 4 files changed, 19 insertions(+), 9 deletions(-) (limited to 'cutl') diff --git a/cutl/Makefile.am b/cutl/Makefile.am index 345fcd5..ca5adc5 100644 --- a/cutl/Makefile.am +++ b/cutl/Makefile.am @@ -8,6 +8,10 @@ EXTRA_DIST = __file__(extra_dist) lib_LTLIBRARIES = libcutl.la libcutl_la_SOURCES = __path__(sources) +if !LIBCUTL_EXTERNAL_BOOST +libcutl_la_SOURCES += __path__(boost_sources) +endif + cutlincludedir = $(includedir)/cutl nobase_cutlinclude_HEADERS = __path__(headers) nobase_nodist_cutlinclude_HEADERS = details/config.h diff --git a/cutl/details/config.h.in b/cutl/details/config.h.in index 5049b74..a3f0c51 100644 --- a/cutl/details/config.h.in +++ b/cutl/details/config.h.in @@ -10,5 +10,6 @@ #define CUTL_DETAILS_CONFIG_H #undef LIBCUTL_STATIC_LIB +#undef LIBCUTL_EXTERNAL_BOOST #endif /* CUTL_DETAILS_CONFIG_H */ diff --git a/cutl/makefile b/cutl/makefile index c1c3b37..505bb41 100644 --- a/cutl/makefile +++ b/cutl/makefile @@ -5,18 +5,18 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make -cxx_tun := exception.cxx shared-ptr/base.cxx +sources := exception.cxx shared-ptr/base.cxx -cxx_tun += fs/exception.cxx fs/path.cxx fs/auto-remove.cxx +sources += fs/exception.cxx fs/path.cxx fs/auto-remove.cxx -cxx_tun += re/re.cxx +sources += re/re.cxx -cxx_tun += \ +sources += \ compiler/context.cxx \ compiler/type-info.cxx \ compiler/cxx-indenter.cxx -cxx_tun += \ +boost_sources := \ details/boost/regex/src/regex.cxx \ details/boost/regex/src/usinstances.cxx \ details/boost/regex/src/regex_raw_buffer.cxx \ @@ -35,7 +35,7 @@ details/boost/regex/src/static_mutex.cxx \ details/boost/regex/src/icu.cxx \ details/boost/regex/src/winstances.cxx - +cxx_tun := $(sources) $(boost_sources) cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) cxx_od := $(cxx_obj:.o=.o.d) @@ -74,7 +74,8 @@ $(out_base)/: $(cutl.l) # Dist. # -$(dist): export sources := $(cxx_tun) +$(dist): export sources := $(sources) +$(dist): export boost_sources := $(boost_sources) $(dist): export headers := $(subst $(src_base)/,,$(shell find $(src_base) \ -name '*.hxx' -o -name '*.ixx' -o -name '*.txx')) $(dist): data_dist := details/config-vc.h $(subst $(src_base)/,,$(shell find \ @@ -86,7 +87,7 @@ $(dist): export interface_version = $(shell sed -e \ 's/^\([0-9]*\.[0-9]*\).*/\1/' $(src_root)/version) $(dist): - $(call dist-data,$(sources) $(headers) $(data_dist) details/config.h.in) + $(call dist-data,$(sources) $(boost_sources) $(headers) $(data_dist) details/config.h.in) $(call meta-vc9proj,libcutl-vc9.vcproj) $(call meta-vc10proj,libcutl-vc10.vcxproj) $(call meta-automake) diff --git a/cutl/re/re.cxx b/cutl/re/re.cxx index 9cd2f2e..96d5651 100644 --- a/cutl/re/re.cxx +++ b/cutl/re/re.cxx @@ -7,7 +7,11 @@ #include -#include +#ifndef LIBCUTL_EXTERNAL_BOOST +# include +#else +# include +#endif using namespace std; -- cgit v1.1