#!/bin/sh
#require compiletest
#require cflags
#phase init
#after init_cflags
#phase header
case $PHASE in
	init)
		dispn "Checking to see if compiler needs -lsocket -lnsl..."
		PROGRAM="#include <sys/types.h>
#include <sys/socket.h>
int main () {
	socket(0,0,0);
	return 0;
}"
		compile_test_wrapper "$PROGRAM" "" "" "-lsocket -lnsl" || \
		disp "no"
		;;
	header)
		disp "Adding \"#include <sys/types.h>\" to header"
		$ECHO "#include <sys/types.h>"
		disp "Adding \"#include <sys/socket.h>\" to header"
		$ECHO "#include <sys/socket.h>"
		;;
esac
