From bfac404a0f667a9294d19e1151852009bf157ce4 Mon Sep 17 00:00:00 2001 From: Rene Rivera Date: Thu, 6 Aug 2015 20:51:56 -0500 Subject: [PATCH] Bump to version 1.4 for next release. Switched BBv2 check support to use the compile only check utility to address cross-compile use cases. --- check/predef.jam | 58 ++++++------------- check/predef_check_cc.h | 19 ++++++ check/predef_check_cc_as_c.c | 7 +++ check/predef_check_cc_as_cpp.cpp | 7 +++ check/predef_check_cc_as_objc.m | 7 +++ check/predef_check_cc_as_objcpp.mm | 7 +++ doc/history.qbk | 7 +++ doc/html/index.html | 11 ++-- doc/html/predef/acknoledgements.html | 6 +- doc/html/predef/adding_new_predefs.html | 6 +- doc/html/predef/check_utilities.html | 6 +- doc/html/predef/history.html | 24 ++++++-- doc/html/predef/introduction.html | 8 +-- doc/html/predef/reference.html | 7 ++- .../boost_arch_architecture_macros.html | 4 +- .../reference/boost_comp_compiler_macros.html | 4 +- .../boost_lang_language_standards_ma.html | 4 +- .../reference/boost_lib_library_macros.html | 4 +- .../boost_os_operating_system_macros.html | 4 +- .../reference/boost_plat_platform_macros.html | 10 ++-- doc/html/predef/reference/other_macros.html | 10 ++-- .../reference/version_definition_macros.html | 4 +- doc/html/predef/to_do.html | 6 +- doc/html/predef/using_the_predefs.html | 14 ++++- doc/predef.qbk | 2 +- include/boost/predef/version.h | 2 +- 26 files changed, 154 insertions(+), 94 deletions(-) create mode 100644 check/predef_check_cc.h create mode 100644 check/predef_check_cc_as_c.c create mode 100644 check/predef_check_cc_as_cpp.cpp create mode 100644 check/predef_check_cc_as_objc.m create mode 100644 check/predef_check_cc_as_objcpp.mm diff --git a/check/predef.jam b/check/predef.jam index 795c333..11dfbf9 100644 --- a/check/predef.jam +++ b/check/predef.jam @@ -21,29 +21,30 @@ project.extension predef check ; # Feature to pass check expressions to check programs. feature.feature predef-expression : : free ; -# Check programs. Each needs to be compiled for different languages +.c.ext = c ; +.cpp.ext = cpp ; +.objc.ext = m ; +.objcpp.ext = mm ; + +# Check targets. Each needs to be compiled for different languages # even though they are all the same source code. -local rule check_target ( language : ext ) +local rule check_target ( language key : requirements * ) { # Need to use absolute paths because we don't know the # context of the invocation which affects where the paths # originate from. local predef_jam = [ modules.binding $(__name__) ] ; - local source_path - = $(predef_jam:D)/predef_check_as_$(language).$(ext) ; - local include_path - = $(predef_jam:D)/../include ; - _check_exe_($(language)) = [ - exe predef_check_as_$(language) - : $(source_path) - : $(include_path) ] ; - explicit predef_check_as_$(language) ; + local source_path + = $(predef_jam:D)/predef_check_cc_as_$(language).$(.$(language).ext) ; + local include_path + = $(predef_jam:D)/../include ; + obj predef_check_cc_$(key) + : $(source_path) + : $(include_path) $(requirements) ; + explicit predef_check_cc_$(key) ; + return predef_check_cc_$(key) ; } -check_target c : c ; -check_target cpp : cpp ; -check_target objc : m ; -check_target objcpp : mm ; # Checks the expressions and when used evaluates to the true-properties # if the expressions are all true. Otherwise evaluates to the @@ -65,26 +66,16 @@ rule check ( expressions + : language ? : true-properties * : false-properties * } else { - # The check program to use. - local exe_target = [ $(_check_exe_($(language))).name ] ; - exe_target = /check/predef//$(exe_target) ; - # Create the check run if we don't have one yet. local key = [ MD5 $(language)::$(expression) ] ; if ! ( $(key) in $(_checks_) ) { _checks_ += $(key) ; - _message_(/check/predef//$(key).txt) = $(expression) ; - make - $(key).txt : - $(exe_target) : - @$(__name__).predef_check_action : - $(expression) ; - explicit - $(key).txt ; + _message_(/check/predef//predef_check_cc_$(key)) = $(expression) ; + check_target $(language) $(key) : "\"-DCHECK=$(expression)\"" ; } - terms += /check/predef//$(key).txt ; + terms += /check/predef//predef_check_cc_$(key) ; } } local instance = [ new check-expression-evaluator @@ -102,17 +93,6 @@ rule require ( expressions + : language ? ) return [ check $(expressions) : $(language) : : no ] ; } -rule predef_check_action ( targets + : sources + : props * ) -{ - PREDEF_CHECK_EXPRESSION on $(targets) - = [ feature.get-values : $(props) ] ; -} - -actions predef_check_action bind PREDEF_CHECK_EXPRESSION -{ - $(>) "$(PREDEF_CHECK_EXPRESSION)" > $(<) -} - class check-expression-evaluator { import configure ; diff --git a/check/predef_check_cc.h b/check/predef_check_cc.h new file mode 100644 index 0000000..da7609e --- /dev/null +++ b/check/predef_check_cc.h @@ -0,0 +1,19 @@ +/* +Copyright Rene Rivera 2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ +#include + +#ifdef CHECK +# if ((CHECK) == 0) +# error "FAILED" +# endif +#endif + +int dummy() +{ + static int d = 0; + return d++; +} diff --git a/check/predef_check_cc_as_c.c b/check/predef_check_cc_as_c.c new file mode 100644 index 0000000..24fab13 --- /dev/null +++ b/check/predef_check_cc_as_c.c @@ -0,0 +1,7 @@ +/* +Copyright Rene Rivera 2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ +#include "predef_check_cc.h" diff --git a/check/predef_check_cc_as_cpp.cpp b/check/predef_check_cc_as_cpp.cpp new file mode 100644 index 0000000..24fab13 --- /dev/null +++ b/check/predef_check_cc_as_cpp.cpp @@ -0,0 +1,7 @@ +/* +Copyright Rene Rivera 2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ +#include "predef_check_cc.h" diff --git a/check/predef_check_cc_as_objc.m b/check/predef_check_cc_as_objc.m new file mode 100644 index 0000000..24fab13 --- /dev/null +++ b/check/predef_check_cc_as_objc.m @@ -0,0 +1,7 @@ +/* +Copyright Rene Rivera 2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ +#include "predef_check_cc.h" diff --git a/check/predef_check_cc_as_objcpp.mm b/check/predef_check_cc_as_objcpp.mm new file mode 100644 index 0000000..24fab13 --- /dev/null +++ b/check/predef_check_cc_as_objcpp.mm @@ -0,0 +1,7 @@ +/* +Copyright Rene Rivera 2015 +Distributed under the Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ +#include "predef_check_cc.h" diff --git a/doc/history.qbk b/doc/history.qbk index 4c8833f..1e63c01 100644 --- a/doc/history.qbk +++ b/doc/history.qbk @@ -7,6 +7,13 @@ http://www.boost.org/LICENSE_1_0.txt) [section History] +[heading 1.4] + +* Add detection of SIMD hardware. With the addition of the `BOOST_HW_*` + category (from Charly Chevalier). +* Add compile only version of check utilities to address cross-compile + use cases. And changed the BBv2 check support to use compile only checks. + [heading 1.3] * Fix many problems with `predef_check` functionality. diff --git a/doc/html/index.html b/doc/html/index.html index 4e9d22c..322d814 100644 --- a/doc/html/index.html +++ b/doc/html/index.html @@ -1,10 +1,10 @@ -Predef 1.3 +Predef 1.4 - + @@ -13,12 +13,14 @@

-Predef 1.3

+Predef 1.4

Rene Rivera

+
+

Distributed under the Boost Software License, Version 1.0. (See accompanying @@ -42,6 +44,7 @@

BOOST_LIB library macros
BOOST_OS operating system macros
BOOST_PLAT platform macros
+
BOOST_HW hardware macros
Other macros
Version definition macros
@@ -54,7 +57,7 @@
- +

Last revised: July 01, 2015 at 22:17:15 GMT

Last revised: August 07, 2015 at 01:42:50 GMT


diff --git a/doc/html/predef/acknoledgements.html b/doc/html/predef/acknoledgements.html index 1a97b32..ccf5767 100644 --- a/doc/html/predef/acknoledgements.html +++ b/doc/html/predef/acknoledgements.html @@ -4,8 +4,8 @@ Acknoledgements - - + + @@ -36,7 +36,7 @@