HELP for compiling custom STK500boot.c

Hello, I need help to compile this STK500boot.c
I cannot compile it,on my mac, can someone please compile it for me?
I have too many error during compiling.I have Xcode installed and an AVRISP MKII as programmer.

I need to modify from row 508 to row 527 of the original STK500boot.c and obtain an HEX file,
this is the changed rows:

while (boot_state==0)
	{
		while ((!(Serial_Available())) && (boot_state == 0))		// wait for data
		{
		//	_delay_ms(0.001);
		//	boot_timer++;
		//	if (boot_timer > boot_timeout)
		//	{
			boot_state	=	1; // (after ++ -> boot_state=2 bootloader timeout, jump to main 0x00000 )
	//		}
	//	#ifdef BLINK_LED_WHILE_WAITING
	//		if ((boot_timer % 7000) == 0)
	//		{
				//*	toggle the LED
	//			PROGLED_PORT	^=	(1<<PROGLED_PIN);	// turn LED ON
			}
		#endif
		}
		boot_state++; // ( if boot_state=1 bootloader received byte from UART, enter bootloader mode)
	}

Thanks! giorgiofox@gmail.com