Ver Fonte

- 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 há 17 anos atrás
pai
commit
0302312745
3 ficheiros alterados com 42 adições e 6 exclusões
  1. 14 0
      INSTALL
  2. 26 6
      Makefile.defs
  3. 2 0
      NEWS

+ 14 - 0
INSTALL

@@ -35,6 +35,8 @@ TOC
 -------------------------------------------
 
 Supported operating systems: Linux, FreeBSD, NetBSD, OpenBSD, Solaris, Darwin
+Partially supported: Windows+Cygwin (core + static modules only, no IPv6,
+ no TCP, no dynamic modules)
 Supported architectures: i386, x86_64 (amd64), armv4l, sparc64, powerpc,
  powerpc64
 Experimental architectures: mips1, mips2, sparc32, alpha
@@ -138,6 +140,18 @@ OS Notes:
       (or, if you want to use the pre-built modules:
        apt-get install ser ser-cpl-module ser-jabber-module ser-mysq-module ser-pa-module ser-postgres-module ser-radius-modules )
 
+ Cygwin  (alpha state, partial support)
+
+ make sure make, bison, flex, minires and minires-devel (needed for the resolver functions) are installed. 
+ 
+ Only building ser's core and some static modules is supported for now.
+ Stuff known not to work:
+           - IPv6 (cygwin doesn't support it yet)
+           - TCP (the tcp code heavily depends on file descriptor passing 
+             between processes, which is not yet supported by cygwin)
+           - dynamic modules (non statically linked -- not supported because
+             backlinking doesn't work in windows by design)
+
 
   Compile example (all the modules and ser in a tar.gz):
      make bin include_modules="mysql jabber cpl-c auth_radius group_radius uri_radius postgres pa"

+ 26 - 6
Makefile.defs

@@ -78,12 +78,13 @@ MAIN_NAME=ser
 VERSION = 2
 PATCHLEVEL = 1
 SUBLEVEL =  0
-EXTRAVERSION = -dev18-tcp
+EXTRAVERSION = -dev19-tcp
 
 SER_VER = $(shell expr $(VERSION) \* 1000000 + $(PATCHLEVEL) \* 1000 + \
 			$(SUBLEVEL) )
 RELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
-OS = $(shell uname -s | sed -e s/SunOS/solaris/ | tr "[A-Z]" "[a-z]")
+OS = $(shell uname -s | sed -e s/SunOS/solaris/ -e s/CYGWIN.*/cygwin/ \
+		 | tr "[A-Z]" "[a-z]")
 
 ifeq ($(OS),solaris)
 	GETARCH=isainfo -n
@@ -445,6 +446,7 @@ DEFS+= $(extra_defs) \
 	 -DUSE_DNS_FAILOVER \
 	 -DUSE_DST_BLACKLIST \
 	 -DUSE_NAPTR \
+	 -DDBG_QM_MALLOC \
 	 #-DUSE_DNS_CACHE_STATS \
 	 #-DUSE_DST_BLACKLIST_STATS \
 	 #-DDNS_WATCHDOG_SUPPORT \
@@ -543,7 +545,7 @@ ifeq ($(CC_NAME), gcc)
 endif
 endif
 
-# arh. specific definitions
+# arch. specific definitions
 ifeq ($(ARCH), i386)
 	use_fast_lock=yes
 endif
@@ -1530,11 +1532,29 @@ ifeq ($(OS), darwin)
 	YACC=yacc
 endif
 
-ifneq (,$(findstring CYGWIN, $(OS)))
-	#cygwin is the same as common
+ifneq (,$(findstring cygwin, $(OS)))
+	# cygwin doesn't support IPV6 and doesn't support fd passing so no TCP
+	DEFS:=$(filter-out -DUSE_IPV6 -DUSE_TCP, $(DEFS))
+	DEFS+=-DHAVE_UNION_SEMUN -DHAVE_SCHED_YIELD \
+			-DHAVE_MSG_NOSIGNAL -DHAVE_MSGHDR_MSG_CONTROL -DHAVE_ALLOCA_H \
+			-DHAVE_TIMEGM -DHAVE_SCHED_SETSCHEDULER
 	ifneq ($(found_lock_method), yes)
-		DEFS+= -DUSE_SYSV_SEM  # try sys v sems
+		DEFS+= -DUSE_POSIX_SEM
+		#DEFS+= -DUSE_SYSV_SEM  # try posix sems
+		# PTHREAD_MUTEX do not work for processes (try test/pthread_test.c)
+		#LIBS+= -lpthread
 		found_lock_method=yes
+	else
+		ifneq (,$(findstring -DUSE_POSIX_SEM, $(DEFS)))
+			#LIBS+=-lpthread
+		endif
+		ifneq (,$(findstring -DUSE_PTHREAD_MUTEX, $(DEFS)))
+$(error PTHREAD_MUTEX do not work for processes on Windows/CYGWIN)
+		endif
+	endif
+	# check for >= 2.5.70
+	ifeq ($(NO_SELECT),)
+		DEFS+=-DHAVE_SELECT
 	endif
 endif
 

+ 2 - 0
NEWS

@@ -126,6 +126,8 @@ modules:
                         - t_set_retr(t1, t2) - changes the retransmissions
                            intervals on the fly, on a per transaction basis.
 core:
+             - partial cygwin (windows) support revived: core+static modules, 
+               no ipv6, no tcp, no dynamic modules
              - most of the config variables can now be changed on the fly,
                without ser restart  (migration work in progress)
              - tcp improvements (better tcp timers, send fd cache, special