summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikolai Merinov <n.merinov@samsung.com>2019-01-30 09:02:25 (GMT)
committerNikolai Merinov <n.merinov@samsung.com>2019-02-12 06:27:05 (GMT)
commit5a5f223066da7a5a797ac37482ec1fd55ad12e9e (patch)
tree58681e5bdcbfde35383d75bf66eeba1a3f68ff24
parent19bc0ae04846b66e010064545c66a1b6f1a042ac (diff)
downloadboost-5a5f223066da7a5a797ac37482ec1fd55ad12e9e.zip
boost-5a5f223066da7a5a797ac37482ec1fd55ad12e9e.tar.gz
boost-5a5f223066da7a5a797ac37482ec1fd55ad12e9e.tar.bz2
Support build with clang
For clang based build we use 'CC=clang --target=x86_64-tizen-linux-gnu' configuration. In order to build boost we should move '--target' argument to CFLAGS and explicitely provide name of toolset. Clean out -Wl,--as-needed. With this flag headers compilation fails with: > clang-5.0: error: cannot specify -o when generating multiple output files
-rw-r--r--packaging/boost.spec15
1 files changed, 14 insertions, 1 deletions
diff --git a/packaging/boost.spec b/packaging/boost.spec
index 13fd083..73520c7 100644
--- a/packaging/boost.spec
+++ b/packaging/boost.spec
@@ -368,6 +368,18 @@ find -type f ! \( -name \*.sh -o -name \*.py -o -name \*.pl \) -exec chmod -x {}
find . -name \*.orig -exec rm {} +
%build
+# Move mandatory flags to corresponding FLAGS variables
+if [ -n "${CXX}" ]; then
+ if echo "$CXXFLAGS" | grep -q -- '-Wl,--as-needed'; then
+ LDFLAGS="$LDFLAGS -Wl,--as-needed"
+ fi
+ LDFLAGS="$(echo ${CC:-gcc} | sed 's/^[^ ]*//') $LDFLAGS"
+ CFLAGS="$(echo ${CC:-gcc} | sed 's/^[^ ]*//') $(echo $CFLAGS | sed 's/ -Wl,--as-needed//g')"
+ CXXFLAGS="$(echo ${CXX:-g++} | sed 's/^[^ ]*//') $(echo $CXXFLAGS | sed 's/ -Wl,--as-needed//g')"
+ CC="$(echo ${CC:-gcc} | sed 's/ .*$//')"
+ CXX="$(echo ${CXX:-g++} | sed 's/ .*$//')"
+fi
+
find . -type f -exec chmod u+w {} +
# Create shared build instructions
@@ -413,7 +425,8 @@ touch user-config.jam
# see also: https://svn.boost.org/trac/boost/ticket/9304
./bootstrap.sh $LIBRARIES_FLAGS \
--prefix=%{_prefix} --exec-prefix=%{_bindir} \
- --libdir=%{_libdir} --includedir=%{_includedir}
+ --libdir=%{_libdir} --includedir=%{_includedir} \
+ --with-toolset=${CC}
# add specific wishes in user-config.jam
%if %build_docs