Accepting request 178193 from home:Andreas_Schwab:Factory

- Build context library only on supported architectures
- Reenable mpi on aarch64
- Avoid duplication between %build and %install

OBS-URL: https://build.opensuse.org/request/show/178193
OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/boost?expand=0&rev=104
This commit is contained in:
Dr. Werner Fink 2013-06-09 13:44:51 +00:00 committed by Git OBS Bridge
parent c910e9a9ad
commit 10c6349ee3
2 changed files with 41 additions and 37 deletions

View File

@ -1,3 +1,10 @@
-------------------------------------------------------------------
Sat Jun 8 08:41:55 UTC 2013 - schwab@suse.de
- Build context library only on supported architectures
- Reenable mpi on aarch64
- Avoid duplication between %build and %install
-------------------------------------------------------------------
Wed May 29 11:48:57 UTC 2013 - varkoly@suse.com

View File

@ -31,12 +31,19 @@
# Just hardcode build_mpi to 1 as soon as openmpi builds on all
# named architectures.
%ifarch s390 s390x ia64 hppa aarch64
%ifarch s390 s390x ia64 hppa
%define build_mpi 0
%else
%define build_mpi 1
%endif
# context hasn't been ported to most architectures yet
%ifarch %ix86 x86_64 %arm mips ppc ppc64
%define build_context 1
%else
%define build_context 0
%endif
%ifarch hppa
%define disable_long_double 1
%else
@ -406,6 +413,8 @@ find . -name \*.orig -exec rm {} +
%build
find . -type f -exec chmod u+w {} +
# Create shared build instructions
cat > .build <<\EOF
# Now build it
J_P=%{jobs}
J_G=$(getconf _NPROCESSORS_ONLN)
@ -416,23 +425,29 @@ if test -z "$JOBS"; then
else
test 1 -gt "$JOBS" && JOBS=1
fi
if test "$JOBS" == "0"; then
if test "$JOBS" = 0; then
JOBS=1
fi
# In case you want more parallel jobs then autobuild grants you
# In case you want more parallel jobs than autobuild grants you
#if [ $J_P -gt $J_I ]; then
# JOBS=$J_G
#fi
%if %{disable_long_double}
export LONG_DOUBLE_FLAGS="--disable-long-double"
%endif
BJAM_CONFIG="-d2 -j$JOBS -sICU_PATH=%{_prefix}"
PYTHON_VERSION=$(python -c 'import sys; print sys.version[:3]')
PYTHON_FLAGS="--with-python-root=/usr --with-python-version=$PYTHON_VERSION"
REGEX_FLAGS="--with-icu"
export EXPAT_INCLUDE=/usr/include EXPAT_LIBPATH=%{_libdir} REGEX_FLAGS="--with-icu"
export REGEX_FLAGS="--with-icu"
export EXPAT_INCLUDE=/usr/include EXPAT_LIBPATH=%{_libdir}
export PYTHON_FLAGS
LIBRARIES_FLAGS=
%if !%build_context
LIBRARIES_FLAGS+=" --without-context"
%endif
EOF
cat << EOF >user-config.jam
# Boost.Build Configuration
@ -459,11 +474,18 @@ cat << EOF >>user-config.jam
using mpi ;
EOF
cat >> .build <<\EOF
# Set PATH, MANPATH and LD_LIBRARY_PATH
source /var/mpi-selector/data/$(rpm --qf "%{NAME}-%{VERSION}" -q openmpi).sh
EOF
%endif
%{_bindir}/bjam ${BJAM_CONFIG} --user-config=user-config.jam ${LONG_DOUBLE_FLAGS} cflags="%{optflags}" cxxflags="%{optflags}" stage || \
# Read shared build instructions
. ./.build
%{_bindir}/bjam ${BJAM_CONFIG} ${LONG_DOUBLE_FLAGS} ${LIBRARIES_FLAGS} \
--user-config=user-config.jam \
cflags="%{optflags}" cxxflags="%{optflags}" stage || \
(echo "Not all Boost libraries built properly."; exit 1)
%if %build_docs
@ -472,38 +494,11 @@ cd doc
%endif
%install
# Now build it
J_P=%{jobs}
J_G=$(getconf _NPROCESSORS_ONLN)
[ $J_G -gt 64 ] && J_G=64
# Read shared build instructions
. ./.build
if test -z "$JOBS"; then
JOBS=$J_G
else
test 1 -gt "$JOBS" && JOBS=1
fi
if test "$JOBS" == "0"; then
JOBS=1
fi
# In case you want more parallel jobs then autobuild grants you
if [ $J_P -gt $J_G ]; then
JOBS=$J_G
fi
BJAM_CONFIG="-d2 -j$JOBS -sICU_PATH=%{_prefix}"
PYTHON_VERSION=$(python -c 'import sys; print sys.version[:3]')
PYTHON_FLAGS="--with-python-root=/usr --with-python-version=$PYTHON_VERSION"
REGEX_FLAGS="--with-icu"
export EXPAT_INCLUDE=/usr/include EXPAT_LIBPATH=%{_libdir} REGEX_FLAGS="--with-icu"
export PYTHON_FLAGS
# Set PATH, MANPATH and LD_LIBRARY_PATH
%if %build_mpi
source /var/mpi-selector/data/$(rpm --qf "%{NAME}-%{VERSION}" -q openmpi).sh
%endif
%{_bindir}/bjam ${BJAM_CONFIG} ${LONG_DOUBLE_FLAGS} --user-config=user-config.jam \
%{_bindir}/bjam ${BJAM_CONFIG} ${LONG_DOUBLE_FLAGS} ${LIBRARIES_FLAGS} \
--user-config=user-config.jam \
--prefix=%{buildroot}%{_prefix} \
--exec-prefix=$%{buildroot}%{_prefix} \
--libdir=%{buildroot}%{_libdir} \
@ -625,9 +620,11 @@ rm -f %{buildroot}%{_libdir}/*.a
%defattr(-, root, root, -)
%{_libdir}/libboost_atomic*.so.*
%if %build_context
%files -n libboost_context%{lib_appendix}
%defattr(-, root, root, -)
%{_libdir}/libboost_context*.so.*
%endif
%files -n libboost_date_time%{lib_appendix}
%defattr(-, root, root, -)