#!/bin/sh
# script for testing the installation
# this has been added to check the post instal hook on osx (Darwin)

set -ev

mkdir -p tmp
cd tmp

cat > test.c <<EOL
#include "flint/fmpz.h"

int main(void)
{
    fmpz_t x;
    fmpz_init(x);
    fmpz_clear(x);
    return 0;
}
EOL

$CC test.c -o test -I${PREFIX}/include -L${PREFIX}/lib -Wl,-rpath,${PREFIX}/lib -lflint -lgmp
if [ $? -ne 0 ];
then
    exit 1;
fi

./test
if [ $? -ne 0 ];
then
    exit 1;
fi
