diff -ru gpstrans-0.39.orig/Makefile gpstrans-0.39/Makefile --- gpstrans-0.39.orig/Makefile 2003-05-21 02:27:14.000000000 +0900 +++ gpstrans-0.39/Makefile 2003-05-21 02:26:43.000000000 +0900 @@ -12,7 +12,7 @@ clean: @echo "Cleaning all in ./" - @rm -f src/core src/gpstrans src/*.o src/*.bak src/*~ src/#*# + @rm -f src/core src/gpstrans src/*.o src/*.bak src/*~ src/#*# src/*.exe @echo "Cleaning all in ./gps" @(cd src/gps ; make clean) @echo "Cleaning all in ./grid" diff -ru gpstrans-0.39.orig/src/Makefile gpstrans-0.39/src/Makefile --- gpstrans-0.39.orig/src/Makefile 2001-02-21 03:35:43.000000000 +0900 +++ gpstrans-0.39/src/Makefile 2003-05-21 02:23:24.000000000 +0900 @@ -11,7 +11,7 @@ # use -DSUNOS41 for SunOS 4.1.x # usr -DHPUX for HPUX -CFLAGS = -Wall -pedantic -g -O3 -D__LINUX__ +CFLAGS = -Wall -pedantic -g -O3 -D__CYGWIN__ LDFLAGS = -lm diff -ru gpstrans-0.39.orig/src/getline/Makefile gpstrans-0.39/src/getline/Makefile --- gpstrans-0.39.orig/src/getline/Makefile 1995-05-30 05:57:57.000000000 +0900 +++ gpstrans-0.39/src/getline/Makefile 2003-05-21 02:23:24.000000000 +0900 @@ -1,4 +1,4 @@ -CC = cc +CC = gcc #CFLAGS = -Wall -DPOSIX CFLAGS = -DPOSIX LDFLAGS= diff -ru gpstrans-0.39.orig/src/gps/Makefile gpstrans-0.39/src/gps/Makefile --- gpstrans-0.39.orig/src/gps/Makefile 1996-11-21 03:18:10.000000000 +0900 +++ gpstrans-0.39/src/gps/Makefile 2003-05-21 02:23:24.000000000 +0900 @@ -9,7 +9,7 @@ ############################################################################## CC = gcc INCLUDES=-I../include -CFLAGS = -g -D__LINUX__ +CFLAGS = -g -D__CIGWIN__ OFILES = sendgpsinfo.o dms.o datum.o calendar.o gpsmessage.o garmincomm.o \ diff -ru gpstrans-0.39.orig/src/gps/garminserial.c gpstrans-0.39/src/gps/garminserial.c --- gpstrans-0.39.orig/src/gps/garminserial.c 2003-05-21 02:27:14.000000000 +0900 +++ gpstrans-0.39/src/gps/garminserial.c 2003-05-21 02:23:24.000000000 +0900 @@ -127,7 +127,11 @@ { int count; +#ifdef __CYGWIN__ + ioctl (ttyfp, TIOCINQ, &count); +#else ioctl (ttyfp, FIONREAD, &count); +#endif return (long) count; } diff -ru gpstrans-0.39.orig/src/gps/getgpsinfo.c gpstrans-0.39/src/gps/getgpsinfo.c --- gpstrans-0.39.orig/src/gps/getgpsinfo.c 2003-05-21 02:27:14.000000000 +0900 +++ gpstrans-0.39/src/gps/getgpsinfo.c 2003-05-21 02:23:24.000000000 +0900 @@ -69,6 +69,14 @@ static float tofloat (unsigned char *p); static short toshort (unsigned char *p); +#ifdef __CYGWIN__ +#define timelocal mktime +time_t timegm(struct tm *tm) { + time_t t_temp=mktime(tm); + struct tm *tm_temp=gmtime(&t_temp); + return (t_temp + (t_temp - mktime(tm_temp))); +} +#endif /****************************************************************************/ @@ -235,26 +243,10 @@ return (0); } - if ((gPrefs.model == 'y')) - { - /* send command and receive package */ - sendGPSMessage (tim1, 4); - getGPSMessage (); - getGPSMessage (); - - } - else - { - /* send command and receive package */ - sendGPSMessage (tim1, 4); - getGPSMessage (); /* this is the ACK-package */ - getGPSMessage (); /* This is of the unknown type 09: leap seconds ? */ - getGPSMessage (); /* This is ACK again */ - getGPSMessage (); /* Stuff */ - } - - - + /* send command and receive package */ + sendGPSMessage (tim1, 4); + getGPSMessage (); + getGPSMessage (); /* close serial device */ serialClose (); diff -ru gpstrans-0.39.orig/src/include/defs.h gpstrans-0.39/src/include/defs.h --- gpstrans-0.39.orig/src/include/defs.h 2003-05-21 02:27:14.000000000 +0900 +++ gpstrans-0.39/src/include/defs.h 2003-05-21 02:26:28.000000000 +0900 @@ -24,6 +24,9 @@ #ifdef __FreeBSD__ #define DefaultServerDevice "/dev/cuaa1" +#endif +#ifdef __CYGWIN__ +#define DefaultServerDevice "/dev/com1" #else #define DefaultServerDevice "/dev/ttyS1" #endif diff -ru gpstrans-0.39.orig/src/main.c gpstrans-0.39/src/main.c --- gpstrans-0.39.orig/src/main.c 2003-05-21 02:27:14.000000000 +0900 +++ gpstrans-0.39/src/main.c 2003-05-21 02:23:24.000000000 +0900 @@ -261,6 +261,10 @@ /* if set-option and uid=root then adjust local time */ if (dowhat == 's') { +#ifdef __CYGWIN__ + fprintf (stderr, "Sorry, Time adjustment is not supported by this OS (Cygwin).\n"); + exit (0); +#else if (getuid () == 0) { if (diffis <= 7200) @@ -279,8 +283,8 @@ } else fprintf (stderr, "\nSorry, only root can set the time.\n"); +#endif } - exit (0); } diff -ru gpstrans-0.39.orig/src/util.c gpstrans-0.39/src/util.c --- gpstrans-0.39.orig/src/util.c 2001-06-17 06:15:30.000000000 +0900 +++ gpstrans-0.39/src/util.c 2003-05-21 02:23:24.000000000 +0900 @@ -30,6 +30,9 @@ #ifdef __LINUX__ #include "time.h" #endif +#ifdef __CYGWIN__ +#include "time.h" +#endif /* define global variables */ char gMessageStr[255];