113 |
fi |
fi |
114 |
|
|
115 |
# run any given command |
# run any given command |
116 |
|
if [[ ${MULTILIB_VERBOSE} = true ]] |
117 |
|
then |
118 |
|
echo -e "${COLGREEN}Executing:${COLDEFAULT} '$@'" |
119 |
|
fi |
120 |
eval $@ || die |
eval $@ || die |
121 |
|
|
122 |
unset ABI CC CXX ABI_LIBDIR |
unset ABI CC CXX ABI_LIBDIR |
166 |
fi |
fi |
167 |
|
|
168 |
# run any given command |
# run any given command |
169 |
|
if [[ ${MULTILIB_VERBOSE} = true ]] |
170 |
|
then |
171 |
|
echo -e "${COLGREEN}Executing:${COLDEFAULT} '$@'" |
172 |
|
fi |
173 |
eval $@ || die |
eval $@ || die |
174 |
|
|
175 |
unset ABI CC CXX ABI_LIBDIR |
unset ABI CC CXX ABI_LIBDIR |
286 |
} |
} |
287 |
fi |
fi |
288 |
|
|
|
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} ] |
|
|
then |
|
|
cd ${BUILDDIR}/build-${abi} |
|
|
else |
|
|
cd ${SRCDIR} |
|
|
fi |
|
|
abi-${abi} oldcmake_configure $@ || 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 |
|
|
# honor inside and outside build-dir builds |
|
|
if [ -d ${BUILDDIR}/build-${abi} ] |
|
|
then |
|
|
cd ${BUILDDIR}/build-${abi} |
|
|
else |
|
|
cd ${SRCDIR}-${abi} |
|
|
fi |
|
|
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 |
|
|
# honor inside and outside build-dir builds |
|
|
if [ -d ${BUILDDIR}/build-${abi} ] |
|
|
then |
|
|
cd ${BUILDDIR}/build-${abi} |
|
|
else |
|
|
cd ${SRCDIR}-${abi} |
|
|
fi |
|
|
abi-${abi} oldmmake DESTDIR=${BINDIR} $@ install || die |
|
|
done |
|
|
} |
|
|
fi |
|
|
|
|
|
if [[ ! -z $(typeset -f mninja) ]] |
|
|
then |
|
|
# rename the old one |
|
|
old_mninja=old$(typeset -f mninja) |
|
|
eval "${old_mninja}" |
|
|
|
|
|
mninja() |
|
|
{ |
|
|
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 |
|
|
echo -e "${COLBLUE}*** ${COLGREEN}compiling for ABI -${abi}${COLDEFAULT}" |
|
|
cd ${SRCDIR}-${abi}/${SRCSUBDIR} |
|
|
abi-${abi} oldmninja $@ || die |
|
|
done |
|
|
} |
|
|
fi |
|
|
|
|
|
if [[ ! -z $(typeset -f meson_configure) ]] |
|
|
then |
|
|
# rename the old one |
|
|
old_meson_configure=old$(typeset -f meson_configure) |
|
|
eval "${old_meson_configure}" |
|
|
|
|
|
meson_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} ] |
|
|
then |
|
|
cd ${BUILDDIR}/build-${abi} |
|
|
else |
|
|
cd ${SRCDIR} |
|
|
fi |
|
|
abi-${abi} oldmeson_configure $@ || die |
|
|
done |
|
|
# restore SRCDIR |
|
|
SRCDIR="${saved_SRCDIR}" |
|
|
} |
|
|
fi |
|
|
|
|
|
if [[ ! -z $(typeset -f meson_src_compile) ]] |
|
|
then |
|
|
# rename the old one |
|
|
old_meson_src_compile=old$(typeset -f meson_src_compile) |
|
|
eval "${old_meson_src_compile}" |
|
|
|
|
|
meson_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 |
|
|
|
|
|
meson_configure || die |
|
|
|
|
|
for abi in ${abis_to_run} |
|
|
do |
|
|
cd ${BUILDDIR}/build-${abi} |
|
|
abi-${abi} oldmninja $@ || die |
|
|
done |
|
|
} |
|
|
fi |
|
|
|
|
|
if [[ ! -z $(typeset -f meson_src_check) ]] |
|
|
then |
|
|
# rename the old one |
|
|
old_meson_src_check=old$(typeset -f meson_src_check) |
|
|
eval "${old_meson_check}" |
|
|
|
|
|
meson_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 |
|
|
# honor inside and outside build-dir builds |
|
|
if [ -d ${BUILDDIR}/build-${abi} ] |
|
|
then |
|
|
cd ${BUILDDIR}/build-${abi} |
|
|
else |
|
|
cd ${SRCDIR}-${abi} |
|
|
fi |
|
|
meson test || die |
|
|
done |
|
|
} |
|
|
fi |
|
|
|
|
|
if [[ ! -z $(typeset -f meson_src_install) ]] |
|
|
then |
|
|
# rename the old one |
|
|
old_meson_src_install=old$(typeset -f meson_src_install) |
|
|
eval "${old_meson_install}" |
|
|
|
|
|
meson_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 |
|
|
# honor inside and outside build-dir builds |
|
|
if [ -d ${BUILDDIR}/build-${abi} ] |
|
|
then |
|
|
cd ${BUILDDIR}/build-${abi} |
|
|
else |
|
|
cd ${SRCDIR}-${abi} |
|
|
fi |
|
|
abi-${abi} DESTDIR=${BINDIR} oldmninja $@ install || die |
|
|
done |
|
|
} |
|
|
fi |
|
|
|
|
289 |
if [[ ! -z $(typeset -f munpack) ]] |
if [[ ! -z $(typeset -f munpack) ]] |
290 |
then |
then |
291 |
# rename the old one |
# rename the old one |
463 |
done |
done |
464 |
} |
} |
465 |
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 |
|