Skip to content

Instantly share code, notes, and snippets.

@vprus vprus/boost.diff
Created Feb 19, 2015

Embed
What would you like to do?
global address-model and architecutre
diff --git a/Jamroot b/Jamroot
index d1b3c3a..779fe54 100644
--- a/Jamroot
+++ b/Jamroot
@@ -136,6 +136,8 @@ constant BOOST_JAMROOT_MODULE : $(__name__) ;
boostcpp.set-version $(BOOST_VERSION) ;
+use-project /boost/architecture : libs/config/checks/architecture ;
+
local all-headers =
[ MATCH .*libs/(.*)/include/boost : [ glob libs/*/include/boost ] ] ;
@@ -162,6 +164,10 @@ if $(all-headers)
project boost
: requirements <include>.
+
+ [ boostcpp.architecture ]
+ [ boostcpp.address-model ]
+
# Disable auto-linking for all targets here, primarily because it caused
# troubles with V2.
<define>BOOST_ALL_NO_LIB=1
diff --git a/boostcpp.jam b/boostcpp.jam
index 257e70d..9a0f53b 100644
--- a/boostcpp.jam
+++ b/boostcpp.jam
@@ -22,7 +22,7 @@ import project ;
import regex ;
import set ;
import targets ;
-
+import property ;
##############################################################################
#
@@ -553,3 +553,70 @@ rule declare-targets ( all-libraries * : headers * )
declare_top_level_targets $(libraries) : $(headers) ;
}
+
+rule deduce-address-model ( properties * )
+{
+ local result = [ property.select <address-model> : $(properties) ] ;
+ if $(result)
+ {
+ return $(result) ;
+ }
+ else
+ {
+ if [ configure.builds /boost/architecture//32 : $(properties) : 32-bit ]
+ {
+ return <address-model>32 ;
+ }
+ else if [ configure.builds /boost/architecture//64 : $(properties) : 64-bit ]
+ {
+ return <address-model>64 ;
+ }
+ }
+}
+
+rule address-model ( )
+{
+ return <conditional>@boostcpp.deduce-address-model ;
+}
+
+rule deduce-architecture ( properties * )
+{
+ local result = [ property.select <architecture> : $(properties) ] ;
+ if $(result)
+ {
+ return $(result) ;
+ }
+ else
+ {
+ if [ configure.builds /boost/architecture//arm : $(properties) : arm ]
+ {
+ return <architecture>arm ;
+ }
+ else if [ configure.builds /boost/architecture//mips1 : $(properties) : mips1 ]
+ {
+ return <architecture>mips1 ;
+ }
+ else if [ configure.builds /boost/architecture//power : $(properties) : power ]
+ {
+ return <architecture>power ;
+ }
+ else if [ configure.builds /boost/architecture//sparc : $(properties) : sparc ]
+ {
+ return <architecture>sparc ;
+ }
+ else if [ configure.builds /boost/architecture//x86 : $(properties) : x86 ]
+ {
+ return <architecture>x86 ;
+ }
+ else if [ configure.builds /boost/architecture//combined : $(properties) : combined ]
+ {
+ return <architecture>combined ;
+ }
+ }
+}
+
+rule architecture ( )
+{
+ return <conditional>@boostcpp.deduce-architecture ;
+}
+
diff --git a/checks/architecture/32.cpp b/checks/architecture/32.cpp
new file mode 100644
index 0000000..d3d2dba
--- /dev/null
+++ b/checks/architecture/32.cpp
@@ -0,0 +1,9 @@
+// 32.cpp
+//
+// Copyright (c) 2012 Steven Watanabe
+//
+// 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)
+
+int test[sizeof(void*) == 4? 1 : -1];
diff --git a/checks/architecture/64.cpp b/checks/architecture/64.cpp
new file mode 100644
index 0000000..5a33bc6
--- /dev/null
+++ b/checks/architecture/64.cpp
@@ -0,0 +1,9 @@
+// 64.cpp
+//
+// Copyright (c) 2012 Steven Watanabe
+//
+// 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)
+
+int test[sizeof(void*) == 8? 1 : -1];
diff --git a/checks/architecture/Jamroot.jam b/checks/architecture/Jamroot.jam
new file mode 100644
index 0000000..ca653b7
--- /dev/null
+++ b/checks/architecture/Jamroot.jam
@@ -0,0 +1,23 @@
+# Jamfile.jam
+#
+# Copyright 2012 Steven Watanabe
+#
+# 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)
+
+project /boost/architecture
+ : requirements
+ -<conditional>@boostcpp.deduce-address-model
+ -<conditional>@boostcpp.deduce-architecture
+ ;
+
+obj 32 : 32.cpp ;
+obj 64 : 64.cpp ;
+
+obj arm : arm.cpp ;
+obj combined : combined.cpp ;
+obj mips1 : mips1.cpp ;
+obj power : power.cpp ;
+obj sparc : sparc.cpp ;
+obj x86 : x86.cpp ;
diff --git a/checks/architecture/arm.cpp b/checks/architecture/arm.cpp
new file mode 100644
index 0000000..6a83737
--- /dev/null
+++ b/checks/architecture/arm.cpp
@@ -0,0 +1,13 @@
+// arm.cpp
+//
+// Copyright (c) 2012 Steven Watanabe
+//
+// 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)
+
+#if !defined(__arm__) && !defined(__thumb__) && \
+ !defined(__TARGET_ARCH_ARM) && !defined(__TARGET_ARCH_THUMB) && \
+ !defined(_ARM) && !defined(_M_ARM)
+#error "Not ARM"
+#endif
diff --git a/checks/architecture/combined.cpp b/checks/architecture/combined.cpp
new file mode 100644
index 0000000..4e5a387
--- /dev/null
+++ b/checks/architecture/combined.cpp
@@ -0,0 +1,21 @@
+// combined.cpp
+//
+// Copyright (c) 2012 Steven Watanabe
+// 2014 Oliver Kowalke
+//
+// 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)
+
+#if !defined(i386) && !defined(__i386__) && !defined(__i386) \
+ && !defined(__i486__) && !defined(__i586__) && !defined(__i686__) \
+ && !defined(_M_IX86) && !defined(__X86__) && !defined(_X86_) \
+ && !defined(__THW_INTEL__) && !defined(__I86__) && !defined(__INTEL__) \
+ && !defined(__amd64__) && !defined(__x86_64__) && !defined(__amd64) \
+ && !defined(__x86_64) && !defined(_M_X64) \
+ && !defined(__powerpc) && !defined(__powerpc__) && !defined(__ppc) \
+ && !defined(__ppc__) && !defined(_M_PPC) && !defined(_ARCH_PPC) \
+ && !defined(__POWERPC__) && !defined(__PPCGECKO__) \
+ && !defined(__PPCBROADWAY) && !defined(_XENON)
+#error "Not combined"
+#endif
diff --git a/checks/architecture/mips1.cpp b/checks/architecture/mips1.cpp
new file mode 100644
index 0000000..adc4a61
--- /dev/null
+++ b/checks/architecture/mips1.cpp
@@ -0,0 +1,11 @@
+// mips1.cpp
+//
+// Copyright (c) 2012 Steven Watanabe
+//
+// 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)
+
+#if !((defined(__mips) && __mips == 1) || defined(_MIPS_ISA_MIPS1) || defined(_R3000))
+#error "Not MIPS1"
+#endif
diff --git a/checks/architecture/power.cpp b/checks/architecture/power.cpp
new file mode 100644
index 0000000..0551194
--- /dev/null
+++ b/checks/architecture/power.cpp
@@ -0,0 +1,14 @@
+// power.cpp
+//
+// Copyright (c) 2012 Steven Watanabe
+//
+// 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)
+
+#if !defined(__powerpc) && !defined(__powerpc__) && !defined(__ppc) \
+ && !defined(__ppc__) && !defined(_M_PPC) && !defined(_ARCH_PPC) \
+ && !defined(__POWERPC__) && !defined(__PPCGECKO__) \
+ && !defined(__PPCBROADWAY) && !defined(_XENON)
+#error "Not PPC"
+#endif
diff --git a/checks/architecture/sparc.cpp b/checks/architecture/sparc.cpp
new file mode 100644
index 0000000..3df2df8
--- /dev/null
+++ b/checks/architecture/sparc.cpp
@@ -0,0 +1,11 @@
+// power.cpp
+//
+// Copyright (c) 2012 Steven Watanabe
+//
+// 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)
+
+#if !defined(__sparc__) && !defined(__sparc)
+#error "Not SPARC"
+#endif
diff --git a/checks/architecture/x86.cpp b/checks/architecture/x86.cpp
new file mode 100644
index 0000000..0d2f9c2
--- /dev/null
+++ b/checks/architecture/x86.cpp
@@ -0,0 +1,16 @@
+// x86.cpp
+//
+// Copyright (c) 2012 Steven Watanabe
+//
+// 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)
+
+#if !defined(i386) && !defined(__i386__) && !defined(__i386) \
+ && !defined(__i486__) && !defined(__i586__) && !defined(__i686__) \
+ && !defined(_M_IX86) && !defined(__X86__) && !defined(_X86_) \
+ && !defined(__THW_INTEL__) && !defined(__I86__) && !defined(__INTEL__) \
+ && !defined(__amd64__) && !defined(__x86_64__) && !defined(__amd64) \
+ && !defined(__x86_64) && !defined(_M_X64)
+#error "Not x86"
+#endif
diff --git a/build/Jamfile.v2 b/build/Jamfile.v2
index 889f28b..799acb0 100644
--- a/build/Jamfile.v2
+++ b/build/Jamfile.v2
@@ -12,7 +12,6 @@ import indirect ;
import modules ;
import os ;
import toolset ;
-import architecture ;
feature.feature segmented-stacks : on : optional propagated composite ;
feature.compose <segmented-stacks>on : <define>BOOST_USE_SEGMENTED_STACKS ;
@@ -803,13 +802,6 @@ alias asm_context_sources
explicit asm_context_sources ;
-alias select_asm_context_sources
- : asm_context_sources
- : [ architecture.architecture ]
- [ architecture.address-model ]
- ;
-
-
alias stack_traits_sources
: windows/stack_traits.cpp
: <target-os>windows
@@ -823,7 +815,7 @@ explicit stack_traits_sources ;
lib boost_context
- : select_asm_context_sources
+ : asm_context_sources
stack_traits_sources
execution_context.cpp
;
diff --git a/config/32.cpp b/config/32.cpp
deleted file mode 100644
index d3d2dba..0000000
--- a/config/32.cpp
+++ /dev/null
@@ -1,9 +0,0 @@
-// 32.cpp
-//
-// Copyright (c) 2012 Steven Watanabe
-//
-// 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)
-
-int test[sizeof(void*) == 4? 1 : -1];
diff --git a/config/64.cpp b/config/64.cpp
deleted file mode 100644
index 5a33bc6..0000000
--- a/config/64.cpp
+++ /dev/null
@@ -1,9 +0,0 @@
-// 64.cpp
-//
-// Copyright (c) 2012 Steven Watanabe
-//
-// 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)
-
-int test[sizeof(void*) == 8? 1 : -1];
diff --git a/config/Jamfile.jam b/config/Jamfile.jam
deleted file mode 100644
index 204c6ed..0000000
--- a/config/Jamfile.jam
+++ /dev/null
@@ -1,19 +0,0 @@
-# Jamfile.jam
-#
-# Copyright 2012 Steven Watanabe
-#
-# 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)
-
-project /boost/architecture ;
-
-obj 32 : 32.cpp ;
-obj 64 : 64.cpp ;
-
-obj arm : arm.cpp ;
-obj combined : combined.cpp ;
-obj mips1 : mips1.cpp ;
-obj power : power.cpp ;
-obj sparc : sparc.cpp ;
-obj x86 : x86.cpp ;
diff --git a/config/arm.cpp b/config/arm.cpp
deleted file mode 100644
index 6a83737..0000000
--- a/config/arm.cpp
+++ /dev/null
@@ -1,13 +0,0 @@
-// arm.cpp
-//
-// Copyright (c) 2012 Steven Watanabe
-//
-// 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)
-
-#if !defined(__arm__) && !defined(__thumb__) && \
- !defined(__TARGET_ARCH_ARM) && !defined(__TARGET_ARCH_THUMB) && \
- !defined(_ARM) && !defined(_M_ARM)
-#error "Not ARM"
-#endif
diff --git a/config/combined.cpp b/config/combined.cpp
deleted file mode 100644
index 4e5a387..0000000
--- a/config/combined.cpp
+++ /dev/null
@@ -1,21 +0,0 @@
-// combined.cpp
-//
-// Copyright (c) 2012 Steven Watanabe
-// 2014 Oliver Kowalke
-//
-// 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)
-
-#if !defined(i386) && !defined(__i386__) && !defined(__i386) \
- && !defined(__i486__) && !defined(__i586__) && !defined(__i686__) \
- && !defined(_M_IX86) && !defined(__X86__) && !defined(_X86_) \
- && !defined(__THW_INTEL__) && !defined(__I86__) && !defined(__INTEL__) \
- && !defined(__amd64__) && !defined(__x86_64__) && !defined(__amd64) \
- && !defined(__x86_64) && !defined(_M_X64) \
- && !defined(__powerpc) && !defined(__powerpc__) && !defined(__ppc) \
- && !defined(__ppc__) && !defined(_M_PPC) && !defined(_ARCH_PPC) \
- && !defined(__POWERPC__) && !defined(__PPCGECKO__) \
- && !defined(__PPCBROADWAY) && !defined(_XENON)
-#error "Not combined"
-#endif
diff --git a/config/mips1.cpp b/config/mips1.cpp
deleted file mode 100644
index adc4a61..0000000
--- a/config/mips1.cpp
+++ /dev/null
@@ -1,11 +0,0 @@
-// mips1.cpp
-//
-// Copyright (c) 2012 Steven Watanabe
-//
-// 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)
-
-#if !((defined(__mips) && __mips == 1) || defined(_MIPS_ISA_MIPS1) || defined(_R3000))
-#error "Not MIPS1"
-#endif
diff --git a/config/power.cpp b/config/power.cpp
deleted file mode 100644
index 0551194..0000000
--- a/config/power.cpp
+++ /dev/null
@@ -1,14 +0,0 @@
-// power.cpp
-//
-// Copyright (c) 2012 Steven Watanabe
-//
-// 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)
-
-#if !defined(__powerpc) && !defined(__powerpc__) && !defined(__ppc) \
- && !defined(__ppc__) && !defined(_M_PPC) && !defined(_ARCH_PPC) \
- && !defined(__POWERPC__) && !defined(__PPCGECKO__) \
- && !defined(__PPCBROADWAY) && !defined(_XENON)
-#error "Not PPC"
-#endif
diff --git a/config/sparc.cpp b/config/sparc.cpp
deleted file mode 100644
index 3df2df8..0000000
--- a/config/sparc.cpp
+++ /dev/null
@@ -1,11 +0,0 @@
-// power.cpp
-//
-// Copyright (c) 2012 Steven Watanabe
-//
-// 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)
-
-#if !defined(__sparc__) && !defined(__sparc)
-#error "Not SPARC"
-#endif
diff --git a/config/x86.cpp b/config/x86.cpp
deleted file mode 100644
index 0d2f9c2..0000000
--- a/config/x86.cpp
+++ /dev/null
@@ -1,16 +0,0 @@
-// x86.cpp
-//
-// Copyright (c) 2012 Steven Watanabe
-//
-// 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)
-
-#if !defined(i386) && !defined(__i386__) && !defined(__i386) \
- && !defined(__i486__) && !defined(__i586__) && !defined(__i686__) \
- && !defined(_M_IX86) && !defined(__X86__) && !defined(_X86_) \
- && !defined(__THW_INTEL__) && !defined(__I86__) && !defined(__INTEL__) \
- && !defined(__amd64__) && !defined(__x86_64__) && !defined(__amd64) \
- && !defined(__x86_64) && !defined(_M_X64)
-#error "Not x86"
-#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.