#!/bin/sh
#require compiletest
#require cflags
#phase init
#after init_cflags
#phase header
case $PHASE in
	init)
		dispn "Checking for math library..."
		PROGRAM="#include <math.h>
int main () {
	sin(1.0);
	return 0;
}"
		compile_test_wrapper "$PROGRAM" "" "" "-lm" || \
		{
			disp "not found, unable to continue"
			exit 1
		}
		;;
	header)
		disp "Adding \"#include <math.h>\" to header"
		$ECHO "#include <math.h>"
		;;
esac
