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 140
       (or, if you want to use the pre-built modules:
139 141
        apt-get install ser ser-cpl-module ser-jabber-module ser-mysq-module ser-pa-module ser-postgres-module ser-radius-modules )
140 142
 
143
+ Cygwin  (alpha state, partial support)
144
+
145
+ make sure make, bison, flex, minires and minires-devel (needed for the resolver functions) are installed. 
146
+ 
147
+ Only building ser's core and some static modules is supported for now.
148
+ Stuff known not to work:
149
+           - IPv6 (cygwin doesn't support it yet)
150
+           - TCP (the tcp code heavily depends on file descriptor passing 
151
+             between processes, which is not yet supported by cygwin)
152
+           - dynamic modules (non statically linked -- not supported because
153
+             backlinking doesn't work in windows by design)
154
+
141 155
 
142 156
   Compile example (all the modules and ser in a tar.gz):
143 157
      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 446
 	 -DUSE_DNS_FAILOVER \
446 447
 	 -DUSE_DST_BLACKLIST \
447 448
 	 -DUSE_NAPTR \
449
+	 -DDBG_QM_MALLOC \
448 450
 	 #-DUSE_DNS_CACHE_STATS \
449 451
 	 #-DUSE_DST_BLACKLIST_STATS \
450 452
 	 #-DDNS_WATCHDOG_SUPPORT \
... ...
@@ -543,7 +545,7 @@ ifeq ($(CC_NAME), gcc)
543 545
 endif
544 546
 endif
545 547
 
546
-# arh. specific definitions
548
+# arch. specific definitions
547 549
 ifeq ($(ARCH), i386)
548 550
 	use_fast_lock=yes
549 551
 endif
... ...
@@ -1530,11 +1532,29 @@ ifeq ($(OS), darwin)
1530 1532
 	YACC=yacc
1531 1533
 endif
1532 1534
 
1533
-ifneq (,$(findstring CYGWIN, $(OS)))
1534
-	#cygwin is the same as common
1535
+ifneq (,$(findstring cygwin, $(OS)))
1536
+	# cygwin doesn't support IPV6 and doesn't support fd passing so no TCP
1537
+	DEFS:=$(filter-out -DUSE_IPV6 -DUSE_TCP, $(DEFS))
1538
+	DEFS+=-DHAVE_UNION_SEMUN -DHAVE_SCHED_YIELD \
1539
+			-DHAVE_MSG_NOSIGNAL -DHAVE_MSGHDR_MSG_CONTROL -DHAVE_ALLOCA_H \
1540
+			-DHAVE_TIMEGM -DHAVE_SCHED_SETSCHEDULER
1535 1541
 	ifneq ($(found_lock_method), yes)
1536
-		DEFS+= -DUSE_SYSV_SEM  # try sys v sems
1542
+		DEFS+= -DUSE_POSIX_SEM
1543
+		#DEFS+= -DUSE_SYSV_SEM  # try posix sems
1544
+		# PTHREAD_MUTEX do not work for processes (try test/pthread_test.c)
1545
+		#LIBS+= -lpthread
1537 1546
 		found_lock_method=yes
1547
+	else
1548
+		ifneq (,$(findstring -DUSE_POSIX_SEM, $(DEFS)))
1549
+			#LIBS+=-lpthread
1550
+		endif
1551
+		ifneq (,$(findstring -DUSE_PTHREAD_MUTEX, $(DEFS)))
1552
+$(error PTHREAD_MUTEX do not work for processes on Windows/CYGWIN)
1553
+		endif
1554
+	endif
1555
+	# check for >= 2.5.70
1556
+	ifeq ($(NO_SELECT),)
1557
+		DEFS+=-DHAVE_SELECT
1538 1558
 	endif
1539 1559
 endif
1540 1560
 
... ...
@@ -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