summaryrefslogtreecommitdiff
path: root/packaging/boost.spec
diff options
context:
space:
mode:
Diffstat (limited to 'packaging/boost.spec')
-rw-r--r--packaging/boost.spec15
1 files changed, 14 insertions, 1 deletions
diff --git a/packaging/boost.spec b/packaging/boost.spec
index 13fd083bf1..73520c7284 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