Browse code

- win/cygwin support revived, for now no ipv6, no tcp (relies on fd passing between processes which is not yet supported under cygwin), no dynamic modules, only statically linking (backlinking is not supported under windows and possible workarounds are too work intensive)

Andrei Pelinescu-Onciul authored on 30/04/2008 20:12:16
Showing 3 changed files
... ...
@@ -35,6 +35,8 @@ TOC
35 35
 -------------------------------------------
36 36
 
37 37
 Supported operating systems: Linux, FreeBSD, NetBSD, OpenBSD, Solaris, Darwin
38
+Partially supported: Windows+Cygwin (core + static modules only, no IPv6,
39
+ no TCP, no dynamic modules)
38 40
 Supported architectures: i386, x86_64 (amd64), armv4l, sparc64, powerpc,
39 41
  powerpc64
40 42
 Experimental architectures: mips1, mips2, sparc32, alpha
... ...
@@ -138,6 +140,18 @@ OS Notes:
138 138
       (or, if you want to use the pre-built modules:
139 139
        apt-get install ser ser-cpl-module ser-jabber-module ser-mysq-module ser-pa-module ser-postgres-module ser-radius-modules )
140 140
 
141
+ Cygwin  (alpha state, partial support)
142
+
143
+ make sure make, bison, flex, minires and minires-devel (needed for the resolver functions) are installed. 
144
+ 
145
+ Only building ser's core and some static modules is supported for now.
146
+ Stuff known not to work:
147
+           - IPv6 (cygwin doesn't support it yet)
148
+           - TCP (the tcp code heavily depends on file descriptor passing 
149
+             between processes, which is not yet supported by cygwin)
150
+           - dynamic modules (non statically linked -- not supported because
151
+             backlinking doesn't work in windows by design)
152
+
141 153
 
142 154
   Compile example (all the modules and ser in a tar.gz):
143 155
      make bin include_modules="mysql jabber cpl-c auth_radius group_radius uri_radius postgres pa"
... ...
@@ -78,12 +78,13 @@ MAIN_NAME=ser
78 78
 VERSION = 2
79 79
 PATCHLEVEL = 1
80 80
 SUBLEVEL =  0
81
-EXTRAVERSION = -dev18-tcp
81
+EXTRAVERSION = -dev19-tcp
82 82
 
83 83
 SER_VER = $(shell expr $(VERSION) \* 1000000 + $(PATCHLEVEL) \* 1000 + \
84 84
 			$(SUBLEVEL) )
85 85
 RELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
86
-OS = $(shell uname -s | sed -e s/SunOS/solaris/ | tr "[A-Z]" "[a-z]")
86
+OS = $(shell uname -s | sed -e s/SunOS/solaris/ -e s/CYGWIN.*/cygwin/ \
87
+		 | tr "[A-Z]" "[a-z]")
87 88
 
88 89
 ifeq ($(OS),solaris)
89 90
 	GETARCH=isainfo -n
... ...
@@ -445,6 +446,7 @@ DEFS+= $(extra_defs) \
445 445
 	 -DUSE_DNS_FAILOVER \
446 446
 	 -DUSE_DST_BLACKLIST \
447 447
 	 -DUSE_NAPTR \
448
+	 -DDBG_QM_MALLOC \
448 449
 	 #-DUSE_DNS_CACHE_STATS \
449 450
 	 #-DUSE_DST_BLACKLIST_STATS \
450 451
 	 #-DDNS_WATCHDOG_SUPPORT \
... ...
@@ -543,7 +545,7 @@ ifeq ($(CC_NAME), gcc)
543 543
 endif
544 544
 endif
545 545
 
546
-# arh. specific definitions
546
+# arch. specific definitions
547 547
 ifeq ($(ARCH), i386)
548 548
 	use_fast_lock=yes
549 549
 endif
... ...
@@ -1530,11 +1532,29 @@ ifeq ($(OS), darwin)
1530 1530
 	YACC=yacc
1531 1531
 endif
1532 1532
 
1533
-ifneq (,$(findstring CYGWIN, $(OS)))
1534
-	#cygwin is the same as common
1533
+ifneq (,$(findstring cygwin, $(OS)))
1534
+	# cygwin doesn't support IPV6 and doesn't support fd passing so no TCP
1535
+	DEFS:=$(filter-out -DUSE_IPV6 -DUSE_TCP, $(DEFS))
1536
+	DEFS+=-DHAVE_UNION_SEMUN -DHAVE_SCHED_YIELD \
1537
+			-DHAVE_MSG_NOSIGNAL -DHAVE_MSGHDR_MSG_CONTROL -DHAVE_ALLOCA_H \
1538
+			-DHAVE_TIMEGM -DHAVE_SCHED_SETSCHEDULER
1535 1539
 	ifneq ($(found_lock_method), yes)
1536
-		DEFS+= -DUSE_SYSV_SEM  # try sys v sems
1540
+		DEFS+= -DUSE_POSIX_SEM
1541
+		#DEFS+= -DUSE_SYSV_SEM  # try posix sems
1542
+		# PTHREAD_MUTEX do not work for processes (try test/pthread_test.c)
1543
+		#LIBS+= -lpthread
1537 1544
 		found_lock_method=yes
1545
+	else
1546
+		ifneq (,$(findstring -DUSE_POSIX_SEM, $(DEFS)))
1547
+			#LIBS+=-lpthread
1548
+		endif
1549
+		ifneq (,$(findstring -DUSE_PTHREAD_MUTEX, $(DEFS)))
1550
+$(error PTHREAD_MUTEX do not work for processes on Windows/CYGWIN)
1551
+		endif
1552
+	endif
1553
+	# check for >= 2.5.70
1554
+	ifeq ($(NO_SELECT),)
1555
+		DEFS+=-DHAVE_SELECT
1538 1556
 	endif
1539 1557
 endif
1540 1558
 
... ...
@@ -126,6 +126,8 @@ modules:
126 126
                         - t_set_retr(t1, t2) - changes the retransmissions
127 127
                            intervals on the fly, on a per transaction basis.
128 128
 core:
129
+             - partial cygwin (windows) support revived: core+static modules, 
130
+               no ipv6, no tcp, no dynamic modules
129 131
              - most of the config variables can now be changed on the fly,
130 132
                without ser restart  (migration work in progress)
131 133
              - tcp improvements (better tcp timers, send fd cache, special