#!/bin/sh

build_dir=$3

cd $build_dir/openlibm-${Y_PORT_VERSION}
make install \
    DESTDIR=$Y_SYSROOT \
    SYSROOT=$Y_SYSROOT \
    ARCH=$Y_ARCH \
    TRIPLE=${Y_ARCH}-unknown-yggdrasil \
    USECLANG=1 \
    CC=clang \
    prefix=/usr \
    >/dev/null

ln -sf libopenlibm.so.4.0 $Y_SYSROOT/usr/lib/libm.so
