7 |
# be verbose or nor (true|false} |
# be verbose or nor (true|false} |
8 |
: ${MULTILIB_VERBOSE="true"} |
: ${MULTILIB_VERBOSE="true"} |
9 |
|
|
10 |
|
# enter the abi srcdir as default setting |
11 |
|
: ${MULTILIB_ENTER_SRCDIR="true"} |
12 |
|
|
13 |
# multilib should call all dependant includes, which gets overridden |
# multilib should call all dependant includes, which gets overridden |
14 |
sminclude mtools |
sminclude mtools |
15 |
|
|
45 |
# the var ist decided with our common eval+echo magic |
# the var ist decided with our common eval+echo magic |
46 |
if [[ -z ${SDEPEND} ]] |
if [[ -z ${SDEPEND} ]] |
47 |
then |
then |
48 |
SDEPEND="\$(eval echo \\\$EMUL_LINUX_32_SDEPEND_\${ARCH/i*86/x86} | tr ';' '\n')" |
SDEPEND="$(marchsdepend EMUL_LINUX_32_SDEPEND)" |
49 |
else |
else |
50 |
SDEPEND="${SDEPEND} |
SDEPEND="${SDEPEND} |
51 |
\$(eval echo \\\$EMUL_LINUX_32_SDEPEND_\${ARCH/i*86/x86} | tr ';' '\n')" |
$(marchsdepend EMUL_LINUX_32_SDEPEND)" |
52 |
fi |
fi |
53 |
fi |
fi |
54 |
|
|
116 |
fi |
fi |
117 |
|
|
118 |
# run any given command |
# run any given command |
119 |
|
if [[ ${MULTILIB_VERBOSE} = true ]] |
120 |
|
then |
121 |
|
echo -e "${COLGREEN}Executing:${COLDEFAULT} '$@'" |
122 |
|
fi |
123 |
eval $@ || die |
eval $@ || die |
124 |
|
|
125 |
unset ABI CC CXX ABI_LIBDIR |
unset ABI CC CXX ABI_LIBDIR |
169 |
fi |
fi |
170 |
|
|
171 |
# run any given command |
# run any given command |
172 |
|
if [[ ${MULTILIB_VERBOSE} = true ]] |
173 |
|
then |
174 |
|
echo -e "${COLGREEN}Executing:${COLDEFAULT} '$@'" |
175 |
|
fi |
176 |
eval $@ || die |
eval $@ || die |
177 |
|
|
178 |
unset ABI CC CXX ABI_LIBDIR |
unset ABI CC CXX ABI_LIBDIR |
193 |
# export this for mpatch etc (to repect only-${abi}) |
# export this for mpatch etc (to repect only-${abi}) |
194 |
export MULTILIB_ONLY_ABI=${abi} |
export MULTILIB_ONLY_ABI=${abi} |
195 |
|
|
196 |
cd ${SRCDIR}-${abi}/${SRCSUBDIR} |
if [[ ${MULTILIB_ENTER_SRCDIR} = true ]] |
197 |
|
then |
198 |
|
cd ${SRCDIR}-${abi}/${SRCSUBDIR} |
199 |
|
fi |
200 |
abi-${abi} $@ || die |
abi-${abi} $@ || die |
201 |
|
|
202 |
# unset this is very important |
# unset this is very important |
217 |
# export this for mpatch etc (to repect only-${abi}) |
# export this for mpatch etc (to repect only-${abi}) |
218 |
export MULTILIB_ONLY_ABI=${abi} |
export MULTILIB_ONLY_ABI=${abi} |
219 |
|
|
220 |
cd ${SRCDIR}-${abi}/${SRCSUBDIR} |
if [[ ${MULTILIB_ENTER_SRCDIR} = true ]] |
221 |
|
then |
222 |
|
cd ${SRCDIR}-${abi}/${SRCSUBDIR} |
223 |
|
fi |
224 |
abi-${abi} $@ || die |
abi-${abi} $@ || die |
225 |
|
|
226 |
# unset this is very important |
# unset this is very important |
234 |
local abi |
local abi |
235 |
for abi in ${MULTILIB_ABIS} |
for abi in ${MULTILIB_ABIS} |
236 |
do |
do |
237 |
cd ${SRCDIR}-${abi}/${SRCSUBDIR} |
if [[ ${MULTILIB_ENTER_SRCDIR} = true ]] |
238 |
|
then |
239 |
|
cd ${SRCDIR}-${abi}/${SRCSUBDIR} |
240 |
|
fi |
241 |
abi-${abi} $@ || die |
abi-${abi} $@ || die |
242 |
done |
done |
243 |
} |
} |
292 |
|
|
293 |
for abi in ${abis_to_run} |
for abi in ${abis_to_run} |
294 |
do |
do |
295 |
cd ${SRCDIR}-${abi}/${SRCSUBDIR} |
if [[ ${MULTILIB_ENTER_SRCDIR} = true ]] |
|
abi-${abi} oldmconfigure $@ || die |
|
|
done |
|
|
} |
|
|
fi |
|
|
|
|
|
if [[ ! -z $(typeset -f cmake_configure) ]] |
|
|
then |
|
|
# rename the old one |
|
|
old_cmake_configure=old$(typeset -f cmake_configure) |
|
|
eval "${old_cmake_configure}" |
|
|
|
|
|
cmake_configure() |
|
|
{ |
|
|
local abi |
|
|
local abis_to_run="${MULTILIB_ABIS}" |
|
|
|
|
|
# respect MULTILIB_ONLY_ABI variable |
|
|
[[ ! -z ${MULTILIB_ONLY_ABI} ]] && abis_to_run="${MULTILIB_ONLY_ABI}" |
|
|
|
|
|
local saved_SRCDIR="${SRCDIR}" |
|
|
for abi in ${abis_to_run} |
|
|
do |
|
|
SRCDIR="${saved_SRCDIR}-${abi}" |
|
|
# honor inside and outside build-dir builds |
|
|
if [ -d ${BUILDDIR}/build-${abi} ] |
|
296 |
then |
then |
297 |
cd ${BUILDDIR}/build-${abi} |
cd ${SRCDIR}-${abi}/${SRCSUBDIR} |
|
else |
|
|
cd ${SRCDIR} |
|
298 |
fi |
fi |
299 |
abi-${abi} oldcmake_configure $@ || die |
abi-${abi} oldmconfigure $@ || die |
|
done |
|
|
# restore SRCDIR |
|
|
SRCDIR="${saved_SRCDIR}" |
|
|
} |
|
|
fi |
|
|
|
|
|
if [[ ! -z $(typeset -f cmake_src_compile) ]] |
|
|
then |
|
|
# rename the old one |
|
|
old_cmake_src_compile=old$(typeset -f cmake_src_compile) |
|
|
eval "${old_cmake_src_compile}" |
|
|
|
|
|
cmake_src_compile() |
|
|
{ |
|
|
local abi |
|
|
local abis_to_run="${MULTILIB_ABIS}" |
|
|
|
|
|
# respect MULTILIB_ONLY_ABI variable |
|
|
[[ ! -z ${MULTILIB_ONLY_ABI} ]] && abis_to_run="${MULTILIB_ONLY_ABI}" |
|
|
|
|
|
for abi in ${abis_to_run} |
|
|
do |
|
|
# remove build dir if exist |
|
|
[[ -d ${BUILDDIR}/build-${abi} ]] && rm -rf ${BUILDDIR}/build-${abi} |
|
|
|
|
|
# build outside of the source dir |
|
|
install -d ${BUILDDIR}/build-${abi} || die |
|
|
cd ${BUILDDIR}/build-${abi} |
|
|
done |
|
|
|
|
|
cmake_configure || die |
|
|
|
|
|
for abi in ${abis_to_run} |
|
|
do |
|
|
cd ${BUILDDIR}/build-${abi} |
|
|
abi-${abi} oldmmake $@ || die |
|
|
done |
|
|
} |
|
|
fi |
|
|
|
|
|
if [[ ! -z $(typeset -f cmake_src_check) ]] |
|
|
then |
|
|
# rename the old one |
|
|
old_cmake_src_check=old$(typeset -f cmake_src_check) |
|
|
eval "${old_cmake_check}" |
|
|
|
|
|
cmake_src_check() |
|
|
{ |
|
|
local abi |
|
|
local abis_to_run="${MULTILIB_ABIS}" |
|
|
|
|
|
# respect MULTILIB_ONLY_ABI variable |
|
|
[[ ! -z ${MULTILIB_ONLY_ABI} ]] && abis_to_run="${MULTILIB_ONLY_ABI}" |
|
|
|
|
|
for abi in ${abis_to_run} |
|
|
do |
|
|
cd ${BUILDDIR}/build-${abi} |
|
|
mmake -j1 -k check || die |
|
|
done |
|
|
} |
|
|
fi |
|
|
|
|
|
if [[ ! -z $(typeset -f cmake_src_install) ]] |
|
|
then |
|
|
# rename the old one |
|
|
old_cmake_src_install=old$(typeset -f cmake_src_install) |
|
|
eval "${old_cmake_install}" |
|
|
|
|
|
cmake_src_install() |
|
|
{ |
|
|
local abi |
|
|
local abis_to_run="${MULTILIB_ABIS}" |
|
|
|
|
|
# respect MULTILIB_ONLY_ABI variable |
|
|
[[ ! -z ${MULTILIB_ONLY_ABI} ]] && abis_to_run="${MULTILIB_ONLY_ABI}" |
|
|
|
|
|
for abi in ${abis_to_run} |
|
|
do |
|
|
# install build outside of the source dir |
|
|
cd ${BUILDDIR}/build-${abi} |
|
|
abi-${abi} oldmmake DESTDIR=${BINDIR} $@ install || die |
|
300 |
done |
done |
301 |
} |
} |
302 |
fi |
fi |
341 |
for abi in ${abis_to_run} |
for abi in ${abis_to_run} |
342 |
do |
do |
343 |
echo -e "${COLBLUE}*** ${COLGREEN}compiling for ABI -${abi}${COLDEFAULT}" |
echo -e "${COLBLUE}*** ${COLGREEN}compiling for ABI -${abi}${COLDEFAULT}" |
344 |
cd ${SRCDIR}-${abi}/${SRCSUBDIR} |
if [[ ${MULTILIB_ENTER_SRCDIR} = true ]] |
345 |
|
then |
346 |
|
cd ${SRCDIR}-${abi}/${SRCSUBDIR} |
347 |
|
fi |
348 |
abi-${abi} oldmmake $@ || die |
abi-${abi} oldmmake $@ || die |
349 |
done |
done |
350 |
} |
} |
367 |
for abi in ${abis_to_run} |
for abi in ${abis_to_run} |
368 |
do |
do |
369 |
echo -e "${COLBLUE}*** ${COLGREEN}installing for ABI -${abi}${COLDEFAULT}" |
echo -e "${COLBLUE}*** ${COLGREEN}installing for ABI -${abi}${COLDEFAULT}" |
370 |
cd ${SRCDIR}-${abi}/${SRCSUBDIR} |
if [[ ${MULTILIB_ENTER_SRCDIR} = true ]] |
371 |
|
then |
372 |
|
cd ${SRCDIR}-${abi}/${SRCSUBDIR} |
373 |
|
fi |
374 |
abi-${abi} oldminstall $@ || die |
abi-${abi} oldminstall $@ || die |
375 |
done |
done |
376 |
} |
} |
387 |
for abi in ${abis_to_run} |
for abi in ${abis_to_run} |
388 |
do |
do |
389 |
echo -e "${COLBLUE}*** ${COLGREEN}installing for ABI -${abi}${COLDEFAULT}" |
echo -e "${COLBLUE}*** ${COLGREEN}installing for ABI -${abi}${COLDEFAULT}" |
390 |
cd ${SRCDIR}-${abi}/${SRCSUBDIR} |
if [[ ${MULTILIB_ENTER_SRCDIR} = true ]] |
391 |
|
then |
392 |
|
cd ${SRCDIR}-${abi}/${SRCSUBDIR} |
393 |
|
fi |
394 |
make DESTDIR=${BINDIR} $@ install || die |
make DESTDIR=${BINDIR} $@ install || die |
395 |
done |
done |
396 |
} |
} |
412 |
for abi in ${abis_to_run} |
for abi in ${abis_to_run} |
413 |
do |
do |
414 |
echo -e "${COLBLUE}*** ${COLGREEN}appling patch for ABI -${abi}${COLDEFAULT}" |
echo -e "${COLBLUE}*** ${COLGREEN}appling patch for ABI -${abi}${COLDEFAULT}" |
415 |
cd ${SRCDIR}-${abi}/${SRCSUBDIR} |
if [[ ${MULTILIB_ENTER_SRCDIR} = true ]] |
416 |
|
then |
417 |
|
cd ${SRCDIR}-${abi}/${SRCSUBDIR} |
418 |
|
fi |
419 |
oldmpatch $@ || die |
oldmpatch $@ || die |
420 |
done |
done |
421 |
} |
} |
438 |
for abi in ${abis_to_run} |
for abi in ${abis_to_run} |
439 |
do |
do |
440 |
echo -e "${COLBLUE}*** ${COLGREEN}running mlibtoolize for ABI -${abi}${COLDEFAULT}" |
echo -e "${COLBLUE}*** ${COLGREEN}running mlibtoolize for ABI -${abi}${COLDEFAULT}" |
441 |
cd ${SRCDIR}-${abi}/${SRCSUBDIR} |
if [[ ${MULTILIB_ENTER_SRCDIR} = true ]] |
442 |
|
then |
443 |
|
cd ${SRCDIR}-${abi}/${SRCSUBDIR} |
444 |
|
fi |
445 |
oldmlibtoolize $@ || die |
oldmlibtoolize $@ || die |
446 |
done |
done |
447 |
} |
} |
464 |
for abi in ${abis_to_run} |
for abi in ${abis_to_run} |
465 |
do |
do |
466 |
echo -e "${COLBLUE}*** ${COLGREEN}running mautoreconf for ABI -${abi}${COLDEFAULT}" |
echo -e "${COLBLUE}*** ${COLGREEN}running mautoreconf for ABI -${abi}${COLDEFAULT}" |
467 |
cd ${SRCDIR}-${abi}/${SRCSUBDIR} |
if [[ ${MULTILIB_ENTER_SRCDIR} = true ]] |
468 |
|
then |
469 |
|
cd ${SRCDIR}-${abi}/${SRCSUBDIR} |
470 |
|
fi |
471 |
oldmautoreconf $@ || die |
oldmautoreconf $@ || die |
472 |
done |
done |
473 |
} |
} |
491 |
|
|
492 |
for abi in ${abis_to_run} |
for abi in ${abis_to_run} |
493 |
do |
do |
494 |
cd ${SRCDIR}-${abi}/${SRCSUBDIR} |
if [[ ${MULTILIB_ENTER_SRCDIR} = true ]] |
495 |
|
then |
496 |
|
cd ${SRCDIR}-${abi}/${SRCSUBDIR} |
497 |
|
fi |
498 |
oldminstalldocs $@ || die |
oldminstalldocs $@ || die |
499 |
done |
done |
500 |
} |
} |
501 |
fi |
fi |
|
|
|
|
## |
|
|
# multilib mbuild wrappers |
|
|
## |
|
|
multilib_src_prepare() |
|
|
{ |
|
|
munpack ${SRCFILE} || die |
|
|
} |
|
|
|
|
|
multilib_src_compile() |
|
|
{ |
|
|
if [[ ! -z $(typeset -f cmake_src_compile) ]] |
|
|
then |
|
|
cmake_src_compile || die |
|
|
else |
|
|
mconfigure || die |
|
|
mmake || die |
|
|
fi |
|
|
} |
|
|
|
|
|
multilib_src_check() |
|
|
{ |
|
|
if [[ ! -z $(typeset -f cmake_src_check) ]] |
|
|
then |
|
|
cmake_src_check || die |
|
|
else |
|
|
mmake -j1 -k check || die |
|
|
fi |
|
|
} |
|
|
|
|
|
multilib_src_install() |
|
|
{ |
|
|
if [[ ! -z $(typeset -f cmake_src_install) ]] |
|
|
then |
|
|
cmake_src_install || die |
|
|
else |
|
|
mmake DESTDIR=${BINDIR} install || die |
|
|
fi |
|
|
|
|
|
local i |
|
|
for abi in ${MULTILIB_ABIS} |
|
|
do |
|
|
cd ${SRCDIR}-${abi}/${SRCSUBDIR} |
|
|
for i in ABOUT-NLS AUTHORS BUGS CHANGES ChangeLog COPYING \ |
|
|
FAQ LICENSE NEWS README TODO |
|
|
do |
|
|
if [ -f ${SRCDIR}-${abi}/${i} ] |
|
|
then |
|
|
minstalldocs ${i} || die |
|
|
fi |
|
|
done |
|
|
done |
|
|
} |
|
|
|
|
|
export_inherits multilib src_prepare src_compile src_check src_install |
|