2013-04-17 14:53:49 +02:00
% if % prepare_build != 0
# first build make-3.82
% if 0 % { ? suse_version } < 01230
cd make -*
CFLAGS = $RPM_OPT_FLAGS ./ configure
make % { ? _smp_mflags }
cd -
% endif
# second build zip-3.0 on older distributions
% if % suse_version < 1140
cd zip30
make % { ? jobs :- j % jobs } - f unix / Makefile prefix =/ usr CC = " gcc $RPM_OPT_FLAGS -DLARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 " generic_gcc
cd -
% endif
#
# Parallel build settings ...
lo_jobs = " % { ?jobs:%jobs} "
% ifarch % arm
% if ! 0 % { ? qemu_user_space_build : 1 }
# native hardware is not that powerful
lo_jobs = " 1 "
% endif
% endif
# do not eat all memory
echo " Available memory: "
free
echo " System limits: "
ulimit - a
lo_jobs_reduced =
if test - n " $lo_jobs " - a " $lo_jobs " - gt 1 ; then
if test `uname -i` = " x86_64 " ; then
mem_per_process = 1000
else
2013-07-30 18:39:30 +02:00
mem_per_process = 800
2013-04-17 14:53:49 +02:00
fi
% if 0 % { ? qemu_user_space_build : 1 }
mem_per_process = 1200
% endif
max_mem = `LANG=C free -t -m | sed -n "s|^Mem: *\([0-9]*\).*$|\1|p"`
max_jobs = " $ (( $max_mem / $mem_per_process )) "
test " $lo_jobs " - gt " $max_jobs " && lo_jobs = " $max_jobs " && lo_jobs_reduced = " yes " && echo " Warning: Reducing number of jobs to $max_jobs because of memory limits "
test " $lo_jobs " - le 0 && lo_jobs = 1 && echo " Warning: Do not use the parallel build at all becuse of memory limits "
fi
# finally set jobs
PARALLEL_BUILD =
if test - n " $lo_jobs " ; then
PARALLEL_BUILD = " --with-parallelism= $lo_jobs "
fi
# using icecream
if test - e " /opt/icecream/bin/gcc " - a - e " /opt/icecream/bin/g++ " ; then
PARALLEL_BUILD = " $PARALLEL_BUILD --enable-icecream "
fi
% endif
# make sure that JAVA_HOME is set correctly
% if 0 % { ? suse_version }
source / etc / profile . d / alljava . sh
% endif
# use RPM_OPT_FLAGS, ...
2013-08-02 09:26:14 +02:00
# FIXME: use -g1 instead of -g; the .o files need about 12GB disk space with full debugging symbols; there is not enough disk space and not enough memory for linking libmerged on the build hosts
2013-07-30 18:39:30 +02:00
# 12.3 has broken cppconnector with wrong incude paths
% if 0 % { ? suse_version } == 01230
2013-08-02 09:26:14 +02:00
ARCH_FLAGS = " `echo $RPM_OPT_FLAGS | sed -e 's/ \ -fexceptions//g' -e 's/^-g /-g1 /g' -e 's/ -g / -g1 /g' -e 's/ -g $ / -g1/g'` -fno-strict-aliasing -I/usr/include/mysql-connector/ "
2013-07-30 18:39:30 +02:00
% else
2013-08-02 09:26:14 +02:00
ARCH_FLAGS = " `echo $RPM_OPT_FLAGS | sed -e 's/ \ -fexceptions//g' -e 's/^-g /-g1 /g' -e 's/ -g / -g1 /g' -e 's/ -g $ / -g1/g'` -fno-strict-aliasing "
2013-07-30 18:39:30 +02:00
% endif
2013-04-17 14:53:49 +02:00
CFLAGS = " $ARCH_FLAGS "
CXXFLAGS = " $ARCH_FLAGS "
export ARCH_FLAGS CFLAGS CXXFLAGS
# FIXME: genccode from the system icu is in /usr/sbin
# FIXME: we need make-3.82 for parallel build
% if 0 % { ? suse_version } < 01230
export PATH = " $RPM_BUILD_DIR /libreoffice-%version/make-%gnu_make_version-gbuild: $PATH :/usr/sbin "
% endif
# use the extra built zip-3.0 on older distributions
% if % suse_version < 1140
export PATH = " $RPM_BUILD_DIR /libreoffice-%version/zip30: $PATH "
% endif