lfs-buildscripts/CH8Build/CH08.49-libffi.sh
2024-10-08 18:50:04 -07:00

46 lines
765 B
Bash

#!/bin/bash
# See https://gcc.gnu.org/onlinedocs/gcc-14.2.0/gcc/x86-Options.html
# for gcc-arch
source versions.sh
GLSOURCES="/sources"
pushd ${GLSOURCES} > /dev/null 2>&1 || myfail "Failed to move to ${GLSOURCES}"
[ -d libffi-${libffi_version} ] && rm -rf libffi-${libffi_version}
tar -zxf ${libffi_tarball}
cd libffi-${libffi_version}
./configure --prefix=/usr \
--disable-static \
--with-gcc-arch=native
make
if [ $? -ne 0 ]; then
myfail "Failed building libffi"
fi
if [ ! -f ${GLSOURCES}/SKIPTESTS ]; then
echo "running libffi make check"
make check > ${GLSOURCES}/libffi.check.log 2>&1
fi
make install
if [ $? -ne 0 ]; then
myfail "Failed installing libffi"
fi
popd
# cleanup
pushd $GLSOURCES
rm -rf libffi-${libffi_version}
popd