Porting fixes.

diff --git a/server/serial.c b/server/serial.c
index 0e4d79f..998d9b6 100644
--- a/server/serial.c
+++ b/server/serial.c
@@ -32,9 +32,15 @@
 #include <sys/types.h>
 #include <time.h>
 #include <unistd.h>
+#ifdef HAVE_UTIME_H
 #include <utime.h>
+#endif
+#ifdef HAVE_TERMIOS_H
 #include <termios.h>
+#endif
+#ifdef HAVE_SYS_IOCTL_H
 #include <sys/ioctl.h>
+#endif
 
 #include "winerror.h"
 #include "winbase.h"