--- ./install.orig	2003-09-04 10:45:54.544147200 -0700
+++ ./install	2003-09-04 11:09:17.291198400 -0700
@@ -355,7 +355,11 @@
 
 blame='Please check http://www.isi.edu/nsnam/ns/ns-problems.html
 for common problems and bug fixes.'
-./configure || die "otcl-$OTCLVER configuration failed! Exiting ..."
+if  [ "${test_cygwin}" = "true" ]; then
+        ./configure --x-libraries=/usr/X11R6/lib --x-includes=/usr/X11R6/include || die "otcl-$OTCLVER configuration failed! Exiting ...";
+else
+        ./configure || die "otcl-$OTCLVER configuration failed! Exiting ...";
+fi
 
 if make 
 then
@@ -376,7 +380,11 @@
 
 cd ./tclcl-$TCLCLVER
 
-./configure || die "tclcl-$TCLCLVER configuration failed! Exiting ..."
+if  [ "${test_cygwin}" = "true" ]; then
+        ./configure --x-libraries=/usr/X11R6/lib --x-includes=/usr/X11R6/include || die "tclcl-$TCLCLVER configuration failed! Exiting ...";
+else
+        ./configure || die "tclcl-$TCLCLVER configuration failed! Exiting ..."
+fi
 
 if make
 then
@@ -397,7 +405,11 @@
 echo "============================================================"
 
 cd ./ns-$NSVER
-./configure || die "Ns configuration failed! Exiting ..."
+if  [ "${test_cygwin}" = "true" ]; then
+        ./configure --x-libraries=/usr/X11R6/lib --x-includes=/usr/X11R6/include || die "Ns configuration failed! Exiting ...";
+else
+        ./configure || die "Ns configuration failed! Exiting ...";
+fi
 
 if make
 then
@@ -418,7 +430,11 @@
 
 cd ./nam-$NAMVER
 
-./configure --with-tclcl=$CUR_PATH/tclcl-$TCLCLVER  || die "Nam configuration failed! Exiting ..."
+if  [ "${test_cygwin}" = "true" ]; then
+        ./configure --x-libraries=/usr/X11R6/lib --x-includes=/usr/X11R6/include --with-tclcl=$CUR_PATH/tclcl-$TCLCLVER  || die "Nam configuration failed! Exiting ...";
+else
+        ./configure --with-tclcl=$CUR_PATH/tclcl-$TCLCLVER  || die "Nam configuration failed! Exiting ...";
+fi
 
 if make
 then 
--- ./ns-2.26/diffusion3/lib/nr/nr.hh.orig	2003-09-04 11:51:03.364755200 -0700
+++ ./ns-2.26/diffusion3/lib/nr/nr.hh	2003-09-04 11:52:08.798844800 -0700
@@ -39,14 +39,16 @@
 
 using namespace std;
 
+#ifndef __CYGWIN__ 
 typedef signed int int32_t;
+#endif
 typedef signed short int16_t;
-#if defined (sparc) || defined (__CYGWIN__)
+#if defined (sparc) 
 typedef char int8_t;
 #else
-// Conflicts with system declaration of int8_t in Solaris and Cygwin
+// Conflicts with system declaration of int8_t in Solaris 
 typedef signed char int8_t;
-#endif // sparc/cygwin
+#endif // sparc
 
 #define FAIL -1
 #define OK    0
--- ./ns-2.26/mcast/lms.h.orig	2003-09-04 11:43:34.389160000 -0700
+++ ./ns-2.26/mcast/lms.h	2003-09-04 11:29:03.146374400 -0700
@@ -80,7 +80,7 @@
     nsaddr_t&	from ()  { return from_;  }
     nsaddr_t&	src ()   { return src_;   }
     nsaddr_t&   tp_addr ()  { return tp_addr_;  }
-    nsaddr_t&   tp_port ()  { return tp_port_;  }
+    nsaddr_t&   tp_port ()  { return (nsaddr_t&) tp_port_;  }
     nsaddr_t&	group () { return group_; }
 };
 
--- ./ns-2.26/tools/flowmon.h.orig	2003-09-04 11:22:02.271185600 -0700
+++ ./ns-2.26/tools/flowmon.h	2003-09-04 11:22:24.022462400 -0700
@@ -54,9 +54,9 @@
 public:
 	Flow() : src_(-1), dst_(-1), fid_(-1), type_(PT_NTYPE) {  
 
-		bind("src_", &src_);
-		bind("dst_", &dst_);
-		bind("flowid_", &fid_);
+		bind("src_", (int*) &src_);
+		bind("dst_", (int*) &dst_);
+		bind("flowid_", (int*) &fid_);
 	}
 	nsaddr_t src() const { return (src_); }
 	nsaddr_t dst() const { return (dst_); }
--- ./ns-2.26/queue/pi.cc.orig	2003-02-26 14:09:12.000000000 -0800
+++ ./ns-2.26/queue/pi.cc	2003-09-16 21:47:27.552680000 -0700
@@ -66,7 +66,7 @@
 PIQueue::PIQueue(const char * trace) : CalcTimer(this), link_(NULL), 
   de_drop_(NULL), EDTrace(NULL), tchan_(0), first_reset_(1)
 {
-	if (strlen(trace) >=20) {
+	if (strlen(trace) >=19) {
 		printf("trace type too long - allocate more space to traceType in pi.h and recompile\n");
 		exit(0);
 	}
--- ./ns-2.26/queue/pi.h.orig	2003-02-26 14:09:12.000000000 -0800
+++ ./ns-2.26/queue/pi.h	2003-09-16 21:49:37.419419200 -0700
@@ -57,7 +57,7 @@
 /*
  * Early drop parameters, supplied by user
  */
-struct edp {
+struct edp_pi {
 	/*
 	 * User supplied.
 	 */
@@ -67,17 +67,18 @@
 	double a, b;		 /* parameters to pi controller */
 	double w;				/* sampling frequency (# of times per second) */ 
 	double qref;		/* desired queue size */
+ 	edp_pi(): mean_pktsize(0), bytes(0), setbit(0), a(0.0), b(0.0), w(0.0), qref(0.0) { }
 };
 
 /*
  * Early drop variables, maintained by PI
  */
-struct edv {
+struct edv_pi {
 	TracedDouble v_prob;	/* prob. of packet drop before "count". */
 	int count;		/* # of packets since last drop */
 	int count_bytes;	/* # of bytes since last drop */
 	int qold;
-	edv() : v_prob(0.0), count(0), count_bytes(0) { }
+	edv_pi() : v_prob(0.0), count(0), count_bytes(0) { }
 };
 
 class LinkDelay;
@@ -123,8 +124,8 @@
 	TracedInt curq_;	/* current qlen seen by arrivals */
 	void trace(TracedVar*);	/* routine to write trace records */
 
-	edp edp_;	/* early-drop params */
-	edv edv_;		/* early-drop variables */
+	edp_pi edp_;	/* early-drop params */
+	edv_pi edv_;		/* early-drop variables */
 
 	int first_reset_;       /* first time reset() is called */
 
