From 6e4ce5db3c976bc6862f109436d04ace5690febd Mon Sep 17 00:00:00 2001 From: Vladimir Prus Date: Wed, 24 Feb 2010 12:26:26 +0000 Subject: [PATCH] Configuration framework and boost.math long long configuration. [SVN r59867] --- build/Jamfile.v2 | 51 ++++++++++++++++++++++++++++++++++++--- src/long_double_check.cpp | 6 +++++ 2 files changed, 53 insertions(+), 4 deletions(-) create mode 100644 src/long_double_check.cpp diff --git a/build/Jamfile.v2 b/build/Jamfile.v2 index eb9c93539..25b23efc7 100644 --- a/build/Jamfile.v2 +++ b/build/Jamfile.v2 @@ -63,11 +63,54 @@ sph_legendre sph_neumann ; -if --disable-long-double in [ modules.peek : ARGV ] -{ - long-double-opts = no ; -} +# Configure checks. + +import project ; +import configure ; +import property ; +import property-set ; + +exe long_double_check : ../src/long_double_check.cpp ; +explicit long_double_check ; + +local .long-double-reported ; +project = [ project.current ] ; + +rule long-double-configure ( properties * ) +{ + local disabled ; + if [ option.get disable-long-double : : yes ] + { + disabled = true ; + } + else + { + # The presence of long double depends only on toolset. + local toolset = [ property.select : $(properties) ] ; + local ps = [ property-set.create $(toolset) ] ; + local ap = [ $(ps).as-path ] ; + + if ! [ configure.builds long_double_check : $(project) : $(ps) + : "long double support" ] + { + if ! $(.long-double-reported) + { + configure.log-component-configuration math : + "long long not available, skipping boost_math_tr1l/boost_math_c99l" ; + .long-double-reported = true ; + } + disabled = true ; + } + } + if $(disabled) + { + return no ; + } +} + +long-double-opts = @long-double-configure ; +# Library targets lib boost_math_tr1 : ../src/tr1/$(TR1_SOURCES).cpp pch : shared:BOOST_MATH_TR1_DYN_LINK=1 diff --git a/src/long_double_check.cpp b/src/long_double_check.cpp new file mode 100644 index 000000000..0838ed874 --- /dev/null +++ b/src/long_double_check.cpp @@ -0,0 +1,6 @@ + +int main() +{ + long double x; + return 0; +}