myserver-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[myserver-commit] [2786] Basic support for cygwin cross-compiling


From: Giuseppe Scrivano
Subject: [myserver-commit] [2786] Basic support for cygwin cross-compiling
Date: Thu, 04 Sep 2008 21:56:25 +0000

Revision: 2786
          http://svn.sv.gnu.org/viewvc/?view=rev&root=myserver&revision=2786
Author:   gscrivano
Date:     2008-09-04 21:56:24 +0000 (Thu, 04 Sep 2008)

Log Message:
-----------
Basic support for cygwin cross-compiling

Modified Paths:
--------------
    trunk/myserver/binaries/web/cgi-src/math_sum/Makefile.am
    trunk/myserver/binaries/web/cgi-src/post/Makefile.am
    trunk/myserver/configure.in
    trunk/myserver/control/Makefile.am
    trunk/myserver/include/base/socket/socket.h
    trunk/myserver/src/Makefile.am
    trunk/myserver/src/base/socket/socket.cpp
    trunk/myserver/src/base/socket/ssl_socket.cpp
    trunk/myserver/src/connections_scheduler/listen_threads.cpp
    trunk/myserver/src/server/server.cpp
    trunk/myserver/tests/Makefile.am
    trunk/myserver/tests/test_mutex.cpp

Modified: trunk/myserver/binaries/web/cgi-src/math_sum/Makefile.am
===================================================================
--- trunk/myserver/binaries/web/cgi-src/math_sum/Makefile.am    2008-09-03 
21:24:01 UTC (rev 2785)
+++ trunk/myserver/binaries/web/cgi-src/math_sum/Makefile.am    2008-09-04 
21:56:24 UTC (rev 2786)
@@ -12,7 +12,7 @@
        
 math_sum.mscgi : $(libmath_sum_a_OBJECTS) $(libmath_sum_a_DEPENDENCIES)
        -rm -f math_sum.mscgi
-       $(CXX) $(libmath_sum_a_OBJECTS) $(libmath_sum_a_LIBADD) -o 
math_sum.mscgi -shared
+       $(CXX) $(libmath_sum_a_OBJECTS) ../../../../src/libmyserver.a 
$(libmath_sum_a_LIBADD)  $(PTHREAD_LIB) $(IDN_LIB) $(XNET_LIB) $(EVENT_LIB) 
$(DL_LIB) $(OPENSSL_LIB) $(ZLIB_LIB) $(XML_LIBS) $(LDFLAGS) -o math_sum.mscgi 
-shared
 
 install : math_sum.mscgi
        $(INSTALL) 'math_sum.mscgi' 
'$(root_prefix)/var/web/cgi-bin/math_sum.mscgi'

Modified: trunk/myserver/binaries/web/cgi-src/post/Makefile.am
===================================================================
--- trunk/myserver/binaries/web/cgi-src/post/Makefile.am        2008-09-03 
21:24:01 UTC (rev 2785)
+++ trunk/myserver/binaries/web/cgi-src/post/Makefile.am        2008-09-04 
21:56:24 UTC (rev 2786)
@@ -12,7 +12,7 @@
 
 post.mscgi : $(libpost_a_OBJECTS) $(libpost_a_DEPENDENCIES)
        -rm -f post.mscgi
-       $(CXX) $(libpost_a_OBJECTS) $(libpost_a_LIBADD) -o post.mscgi -shared
+       $(CXX) $(libpost_a_OBJECTS) ../../../../src/libmyserver.a 
$(libpost_a_LIBADD)  $(PTHREAD_LIB) $(IDN_LIB) $(XNET_LIB) $(EVENT_LIB) 
$(DL_LIB) $(OPENSSL_LIB) $(ZLIB_LIB) $(XML_LIBS) $(LDFLAGS) -o post.mscgi 
-shared
 
 install : post.mscgi
        $(INSTALL) 'post.mscgi' '$(root_prefix)/var/web/cgi-bin/post.mscgi'

Modified: trunk/myserver/configure.in
===================================================================
--- trunk/myserver/configure.in 2008-09-03 21:24:01 UTC (rev 2785)
+++ trunk/myserver/configure.in 2008-09-04 21:56:24 UTC (rev 2786)
@@ -59,16 +59,15 @@
 CXXFLAGS="$CXXFLAGS $_LT_AC_TAGVAR(lt_prog_compiler_pic, CXX)"
 LDFLAGS="$LDFLAGS $_LT_AC_TAGVAR(lt_prog_compiler_pic, CXX)"
 
-AC_SUBST(CFLAGS)
-AC_SUBST(CXFLAGS)
-AC_SUBST(LDFLAGS)
-
 AC_ARG_WITH([root-prefix], [  --with-root-prefix=PREFIX override prefix 
variable for files to be placed in the root], root_prefix=$withval, 
root_prefix="")
 
 AC_ARG_ENABLE([control-gui], [ --disable-control-gui disable the 
myserver-configure GUI program], enable_control="no", enable_control="yes")
 
 AC_ARG_ENABLE([ipv6], [  --enable-ipv6 Build with IPv6 support], 
enable_ipv6="yes", enable_ipv6="")
 
+AC_ARG_ENABLE([cygwin], [ --enable-cygwin Enable cygwin], enable_cygwin="yes", 
enable_cygwin="")
+
+
 root_bindir='${root_prefix}/bin'
 root_sbindir='${root_prefix}/sbin'
 root_sysconfdir='${root_prefix}/etc'
@@ -110,14 +109,17 @@
 
 dnl Looking for pthreads
 GNOME_PTHREAD_CHECK
-if test x$PTHREAD_LIB = x; then
+if test x$PTHREAD_LIB = x  -a "x$enable_cygwin" != "xyes"; then
    AC_MSG_ERROR([
 *** This system appears to have no posix threads
 *** Threads are required for MyServer
 ])
 fi
-AC_DEFINE(HAVE_PTHREAD, 1, [POSIX threads required for MyServer in a 
non-windows environment])
 
+if test x$PTHREAD_LIB != x; then
+   AC_DEFINE(HAVE_PTHREAD, 1, [POSIX threads required for MyServer in a 
non-windows environment])
+fi
+
 dnl See if we need -lxnet for arpa
 AC_CHECK_LIB(xnet, accept, have_xnet=yes)
 if test x$have_xnet = xyes; then
@@ -129,21 +131,23 @@
 
 AC_CHECK_LIB(event, event_add, have_event=yes)
 if test x$have_event = xyes; then
+   AC_CHECK_HEADER(event.h,, 
+   [
+        AC_MSG_WARN([event.h not found which is part of libevent.])
+   ])
    EVENT_LIB="-levent"
 else
    EVENT_LIB=""
-   AC_MSG_ERROR([
+
+   if test "x$enable_cygwin" != "xyes"; then
+      AC_MSG_ERROR([
 *** This system appears to have no libevent
 *** Libevent is required by MyServer
-])
+      ])
+   fi
 fi
 AC_SUBST(EVENT_LIB)
 
-AC_CHECK_HEADER(event.h,, 
-[
-   AC_MSG_WARN([event.h not found which is part of libevent.])
-])
-
 AC_CHECK_FUNCS(event_loopbreak, AC_DEFINE(EVENT_LOOPBREAK, 1, [Define if the 
event_loopbreak function is present]) )
 
 dnl check for Unix98 socklen_t
@@ -160,10 +164,14 @@
 AC_CHECK_LIB(c ,dlopen, have_dl=yes; no_dl_ld=yes)
 
 if test x$have_dl != xyes; then
-   AC_MSG_WARN([
+
+   if test "x$enable_cygwin" != "xyes"; then
+      AC_MSG_WARN([
 *** dlLIB not found
 *** MSCGI support will not function
-])
+    ])
+    fi
+
    DL_LIB=""
    MAKE_MSCGI=no
 else
@@ -174,10 +182,11 @@
 if test x$no_dl_ld = xyes; then
    DL_LIB=""
 fi
+
+
 AC_SUBST(DL_LIB)
 
 
-
 # Libidn checks
 # -------------
 AC_CHECK_HEADER(idna.h,, 
@@ -222,9 +231,16 @@
        CPPFLAGS="$CPPFLAGS $XML_CPPFLAGS"
 fi
 
+OPENSSL_INC=""
 
+AC_ARG_WITH(openssl-include,
+  [[  --with-openssl-include=FILE     Use the given path to the openssl 
include files.]],
+  [
+        OPENSSL_INC=$withval
+  ])
+
 dnl CHECKING FOR OPENSSL
-    for dir in $withval /usr/local/ssl /usr/lib/ssl /usr/ssl /usr/pkg 
/usr/local /usr; do
+    for dir in $OPENSSL_INC /usr/local/ssl /usr/lib/ssl /usr/ssl /usr/pkg 
/usr/local /usr; do
         ssldir="$dir";
         if test -f "$dir/include/openssl/ssl.h"; then
             found_ssl="yes";
@@ -246,7 +262,7 @@
     else
         printf "OpenSSL found in $ssldir\n";
         LDFLAGS="$LDFLAGS -L$ssldir/lib";
-                               OPENSSL_LIB="-lssl" # myserver
+                               OPENSSL_LIB="-lssl -lcrypto" # myserver
         HAVE_SSL="yes"
     fi
     AC_SUBST(HAVE_SSL)
@@ -279,10 +295,10 @@
         AC_DEFINE(GZIP_CHECK_BOUNDS, 1, [Memory checking for Zlib, not defined 
in older vrs])
     fi
 fi
+
 AC_SUBST(ZLIB_LIB)
 
 if test x$enable_control == xyes; then
-
      AC_CHECK_LIB(fltk, main, have_fltk=yes)
     dnl Looking for FLTK
     AM_PATH_FLTK(1.1.0, have_fltk=yes)
@@ -340,10 +356,22 @@
 *** tests driver program will not be built
 ])
     MAKE_TESTS=no
+    CPPUNIT_LDFLAGS=""
 else
     MAKE_TESTS=yes
+    CPPUNIT_LDFLAGS="-lcppunit"
 fi
 
+if test "x$enable_cygwin" = "xyes"; then
+   LDFLAGS="$LDFLAGS -levent_extra -levent_core  -lws2_32 -lgdi32 -lrx 
-luserenv -lole32  -luuid" 
+fi
+
+AC_SUBST(CFLAGS)
+AC_SUBST(CXFLAGS)
+AC_SUBST(LDFLAGS)
+AC_SUBST(CPPUNIT_LDFLAGS)
+
+
 AM_CONDITIONAL(BUILD_TESTS, test "$MAKE_TESTS" = "yes")
 
 AM_CONDITIONAL(BUILD_MSCGI, test "$MAKE_MSCGI" = "yes")
@@ -351,7 +379,7 @@
 
 dnl AC_CONFIG_SUBDIRS()
 AC_CONFIG_FILES([
-    version.h  
+    version.h  
     Makefile
     binaries/Makefile
     binaries/certificates/Makefile
@@ -377,111 +405,111 @@
     documentation/english/style/Makefile
     documentation/english/texts/Makefile
     include/Makefile
-               include/connection/Makefile
-               include/log/Makefile
-               include/conf/Makefile
-               include/conf/mime/Makefile
-               include/conf/security/Makefile
-               include/conf/vhost/Makefile
-               include/connections_scheduler/Makefile
-               include/http_handler/Makefile
-               include/http_handler/wincgi/Makefile
-               include/http_handler/cgi/Makefile
-               include/http_handler/mscgi/Makefile
-               include/http_handler/fastcgi/Makefile
-               include/http_handler/http_file/Makefile
-               include/http_handler/scgi/Makefile
-               include/http_handler/isapi/Makefile
-               include/http_handler/http_dir/Makefile
-               include/base/Makefile
-               include/base/find_data/Makefile
-               include/base/file/Makefile
-               include/base/pipe/Makefile
-               include/base/base64/Makefile
-               include/base/mem_buff/Makefile
-               include/base/home_dir/Makefile
-               include/base/multicast/Makefile
-               include/base/sync/Makefile
-               include/base/safetime/Makefile
-               include/base/socket/Makefile
-               include/base/hash_map/Makefile
-               include/base/dynamic_lib/Makefile
-               include/base/process/Makefile
-               include/base/md5/Makefile
-               include/base/ssl/Makefile
-               include/base/xml/Makefile
-               include/base/files_cache/Makefile
-               include/base/string/Makefile
-               include/base/regex/Makefile
-               include/base/thread/Makefile
-               include/protocol/Makefile
-               include/protocol/ftp/Makefile
-               include/protocol/control/Makefile
-               include/protocol/https/Makefile
-               include/protocol/http/Makefile
-               include/protocol/http/env/Makefile
-               include/filter/Makefile
-               include/filter/gzip/Makefile
-               include/plugin/Makefile
-               include/plugin/executor/Makefile
-               include/plugin/http_manager/Makefile
-               include/plugin/protocol/Makefile
-               include/plugin/filter/Makefile
-               include/plugin/http_command/Makefile
-               include/server/Makefile
+    include/connection/Makefile
+    include/log/Makefile
+    include/conf/Makefile
+    include/conf/mime/Makefile
+    include/conf/security/Makefile
+    include/conf/vhost/Makefile
+    include/connections_scheduler/Makefile
+    include/http_handler/Makefile
+    include/http_handler/wincgi/Makefile
+    include/http_handler/cgi/Makefile
+    include/http_handler/mscgi/Makefile
+    include/http_handler/fastcgi/Makefile
+    include/http_handler/http_file/Makefile
+    include/http_handler/scgi/Makefile
+    include/http_handler/isapi/Makefile
+    include/http_handler/http_dir/Makefile
+    include/base/Makefile
+    include/base/find_data/Makefile
+    include/base/file/Makefile
+    include/base/pipe/Makefile
+    include/base/base64/Makefile
+    include/base/mem_buff/Makefile
+    include/base/home_dir/Makefile
+    include/base/multicast/Makefile
+    include/base/sync/Makefile
+    include/base/safetime/Makefile
+    include/base/socket/Makefile
+    include/base/hash_map/Makefile
+    include/base/dynamic_lib/Makefile
+    include/base/process/Makefile
+    include/base/md5/Makefile
+    include/base/ssl/Makefile
+    include/base/xml/Makefile
+    include/base/files_cache/Makefile
+    include/base/string/Makefile
+    include/base/regex/Makefile
+    include/base/thread/Makefile
+    include/protocol/Makefile
+    include/protocol/ftp/Makefile
+    include/protocol/control/Makefile
+    include/protocol/https/Makefile
+    include/protocol/http/Makefile
+    include/protocol/http/env/Makefile
+    include/filter/Makefile
+    include/filter/gzip/Makefile
+    include/plugin/Makefile
+    include/plugin/executor/Makefile
+    include/plugin/http_manager/Makefile
+    include/plugin/protocol/Makefile
+    include/plugin/filter/Makefile
+    include/plugin/http_command/Makefile
+    include/server/Makefile
     src/Makefile
-               src/connection/Makefile
-               src/log/Makefile
-               src/conf/Makefile
-               src/conf/mime/Makefile
-               src/conf/security/Makefile
-               src/conf/vhost/Makefile
-               src/connections_scheduler/Makefile
-               src/http_handler/Makefile
-               src/http_handler/wincgi/Makefile
-               src/http_handler/cgi/Makefile
-               src/http_handler/mscgi/Makefile
-               src/http_handler/fastcgi/Makefile
-               src/http_handler/http_file/Makefile
-               src/http_handler/scgi/Makefile
-               src/http_handler/isapi/Makefile
-               src/http_handler/http_dir/Makefile
-               src/base/Makefile
-               src/base/find_data/Makefile
-               src/base/file/Makefile
-               src/base/pipe/Makefile
-               src/base/base64/Makefile
-               src/base/mem_buff/Makefile
-               src/base/home_dir/Makefile
-               src/base/multicast/Makefile
-               src/base/sync/Makefile
-               src/base/safetime/Makefile
-               src/base/socket/Makefile
-               src/base/hash_map/Makefile
-               src/base/dynamic_lib/Makefile
-               src/base/process/Makefile
-               src/base/md5/Makefile
-               src/base/ssl/Makefile
-               src/base/xml/Makefile
-               src/base/files_cache/Makefile
-               src/base/string/Makefile
-               src/base/regex/Makefile
-               src/base/thread/Makefile
-               src/protocol/Makefile
-               src/protocol/ftp/Makefile
-               src/protocol/control/Makefile
-               src/protocol/https/Makefile
-               src/protocol/http/Makefile
-               src/protocol/http/env/Makefile
-               src/filter/Makefile
-               src/filter/gzip/Makefile
-               src/plugin/Makefile
-               src/plugin/executor/Makefile
-               src/plugin/http_manager/Makefile
-               src/plugin/protocol/Makefile
-               src/plugin/filter/Makefile
-               src/plugin/http_command/Makefile
-               src/server/Makefile
+    src/connection/Makefile
+    src/log/Makefile
+    src/conf/Makefile
+    src/conf/mime/Makefile
+    src/conf/security/Makefile
+    src/conf/vhost/Makefile
+    src/connections_scheduler/Makefile
+    src/http_handler/Makefile
+    src/http_handler/wincgi/Makefile
+    src/http_handler/cgi/Makefile
+    src/http_handler/mscgi/Makefile
+    src/http_handler/fastcgi/Makefile
+    src/http_handler/http_file/Makefile
+    src/http_handler/scgi/Makefile
+    src/http_handler/isapi/Makefile
+    src/http_handler/http_dir/Makefile
+    src/base/Makefile
+    src/base/find_data/Makefile
+    src/base/file/Makefile
+    src/base/pipe/Makefile
+    src/base/base64/Makefile
+    src/base/mem_buff/Makefile
+    src/base/home_dir/Makefile
+    src/base/multicast/Makefile
+    src/base/sync/Makefile
+    src/base/safetime/Makefile
+    src/base/socket/Makefile
+    src/base/hash_map/Makefile
+    src/base/dynamic_lib/Makefile
+    src/base/process/Makefile
+    src/base/md5/Makefile
+    src/base/ssl/Makefile
+    src/base/xml/Makefile
+    src/base/files_cache/Makefile
+    src/base/string/Makefile
+    src/base/regex/Makefile
+    src/base/thread/Makefile
+    src/protocol/Makefile
+    src/protocol/ftp/Makefile
+    src/protocol/control/Makefile
+    src/protocol/https/Makefile
+    src/protocol/http/Makefile
+    src/protocol/http/env/Makefile
+    src/filter/Makefile
+    src/filter/gzip/Makefile
+    src/plugin/Makefile
+    src/plugin/executor/Makefile
+    src/plugin/http_manager/Makefile
+    src/plugin/protocol/Makefile
+    src/plugin/filter/Makefile
+    src/plugin/http_command/Makefile
+    src/server/Makefile
     tests/Makefile
     ])
 AC_OUTPUT

Modified: trunk/myserver/control/Makefile.am
===================================================================
--- trunk/myserver/control/Makefile.am  2008-09-03 21:24:01 UTC (rev 2785)
+++ trunk/myserver/control/Makefile.am  2008-09-04 21:56:24 UTC (rev 2786)
@@ -1,13 +1,14 @@
 bin_PROGRAMS = myserver-configure 
 myserver_configure_SOURCES = control_client.cpp fltkconfig.cpp language.cpp 
mimetype.cpp\
-                                                                               
                                 myserver-configure.cpp progress.cpp 
service.cpp vector.cpp vhost.cpp
+                myserver-configure.cpp progress.cpp service.cpp vector.cpp 
vhost.cpp
+
 INCLUDES = $(all_includes)
 
-myserver_configure_LDFLAGS = $(all_libraries) ../src/libmyserver.a 
+myserver_configure_LDFLAGS = $(all_libraries) 
 myserver_configure_CXXFLAGS = $(CXXFLAGS) $(XML_CFLAGS) $(FLTK_CFLAGS) 
-DPREFIX=\"$(prefix)\"
-myserver_configure_LDADD = $(XML_LIBS) $(FLTK_LIBS) $(XNET_LIB) $(OPENSSL_LIB)
+myserver_configure_LDADD = ../src/libmyserver.a $(XML_LIBS) $(FLTK_LIBS) 
$(XNET_LIB) $(OPENSSL_LIB) $(LDFLAGS)
 
 EXTRA_DIST = control_client.h fltkconfig.h language.h mimetype.h progress.h 
service.h vector.h vhost.h
 
-all : all-am myserver-configure
-       cp myserver-configure ../binaries/
+all : all-am myserver-configure$(EXEEXT)
+       cp myserver-configure$(EXEEXT) ../binaries/

Modified: trunk/myserver/include/base/socket/socket.h
===================================================================
--- trunk/myserver/include/base/socket/socket.h 2008-09-03 21:24:01 UTC (rev 
2785)
+++ trunk/myserver/include/base/socket/socket.h 2008-09-04 21:56:24 UTC (rev 
2786)
@@ -39,7 +39,7 @@
 #ifndef SOCKETLIBINCLUDED
 extern "C"
 {
-#include <Ws2tcpip.h>
+  //#include <ws2tcpip.h>
 #include <winsock2.h>
 }
 #define SOCKETLIBINCLUDED

Modified: trunk/myserver/src/Makefile.am
===================================================================
--- trunk/myserver/src/Makefile.am      2008-09-03 21:24:01 UTC (rev 2785)
+++ trunk/myserver/src/Makefile.am      2008-09-04 21:56:24 UTC (rev 2786)
@@ -10,22 +10,22 @@
 
 libmyserver.a:
        rm -f libmyserver.a
-       find -iregex .*\\.o | xargs ar cru libmyserver.a
-       ranlib libmyserver.a
+       find -iregex .*\\.o | xargs $(AR) cru libmyserver.a
+       $(RANLIB) libmyserver.a
 
 bin_PROGRAMS = myserver
 myserver_SOURCES = myserver.cpp
 
 INCLUDES = $(all_includes)
 
-myserver_LDADD =       $(all_libraries) $(PTHREAD_LIB) $(IDN_LIB) \
-                                                                               
$(XNET_LIB) $(EVENT_LIB) $(DL_LIB) $(OPENSSL_LIB) $(ZLIB_LIB) \
-                                                                               
$(XML_LIBS)
+myserver_LDADD = libmyserver.a $(all_libraries) $(PTHREAD_LIB) $(IDN_LIB) \
+       $(XNET_LIB) $(EVENT_LIB) $(DL_LIB) $(OPENSSL_LIB) $(ZLIB_LIB) \
+       $(XML_LIBS) $(LDFLAGS)
 
 myserver_DEPENDENCIES = libmyserver.a
 
 myserver_CXXFLAGS = $(CXXFLAGS) $(XML_CFLAGS) -DHOST_STR=\"$(build)\" 
-DPREFIX=\"$(prefix)\"
-myserver_LDFLAGS =  -rdynamic libmyserver.a
+myserver_LDFLAGS =  -rdynamic
 
 build_parser: protocol/ftp/ftp_lexer.lpp protocol/ftp/ftp_parser.ypp
        bison --defines=../include/protocol/ftp/ftp_parser.h 
protocol/ftp/ftp_parser.ypp

Modified: trunk/myserver/src/base/socket/socket.cpp
===================================================================
--- trunk/myserver/src/base/socket/socket.cpp   2008-09-03 21:24:01 UTC (rev 
2785)
+++ trunk/myserver/src/base/socket/socket.cpp   2008-09-04 21:56:24 UTC (rev 
2786)
@@ -23,7 +23,7 @@
 #include <string.h>
 #include <stdio.h>
 #ifdef WIN32
-#include <Ws2tcpip.h>
+//#include <Ws2tcpip.h>
 #endif
 #ifndef WIN32
 #include <sys/types.h>
@@ -162,8 +162,12 @@
 {
    if ( sa == NULL || (sa->ss_family != AF_INET && sa->ss_family != AF_INET6) )
       return 1;//Andu: TODO our error code or what?
-  if ( (sa->ss_family == AF_INET && namelen != sizeof(sockaddr_in)) || 
-  (sa->ss_family == AF_INET6 && namelen != sizeof(sockaddr_in6)) )
+  if ( (sa->ss_family == AF_INET && namelen != sizeof(sockaddr_in)) 
+#if HAVE_IPV6
+  || (sa->ss_family == AF_INET6 && namelen != sizeof(sockaddr_in6))
+#endif
+ )
+
      return 1;//Andu: TODO our error code or what?
 #ifdef WIN32
   return ::bind((SOCKET)socketHandle,(const struct sockaddr*)sa,namelen);
@@ -607,8 +611,11 @@
 {
   if ( sa == NULL || (sa->ss_family != AF_INET && sa->ss_family != AF_INET6) )
     return 1;//Andu: TODO our error code or what?
-  if ( (sa->ss_family == AF_INET && na != sizeof(sockaddr_in)) || 
-       (sa->ss_family == AF_INET6 && na != sizeof(sockaddr_in6)) )
+  if ( (sa->ss_family == AF_INET && na != sizeof(sockaddr_in)) 
+#if HAVE_IPV6
+    || (sa->ss_family == AF_INET6 && na != sizeof(sockaddr_in6))
+#endif
+ )
     return 1;//Andu: TODO our error code or what?
   
 #ifdef WIN32

Modified: trunk/myserver/src/base/socket/ssl_socket.cpp
===================================================================
--- trunk/myserver/src/base/socket/ssl_socket.cpp       2008-09-03 21:24:01 UTC 
(rev 2785)
+++ trunk/myserver/src/base/socket/ssl_socket.cpp       2008-09-04 21:56:24 UTC 
(rev 2786)
@@ -24,7 +24,7 @@
 #include <string.h>
 #include <stdio.h>
 #ifdef WIN32
-#include <Ws2tcpip.h>
+  //#include <Ws2tcpip.h>
 #endif
 #ifndef WIN32
 #include <sys/types.h>
@@ -137,8 +137,11 @@
 {
    if ( sa == NULL || (sa->ss_family != AF_INET && sa->ss_family != AF_INET6) )
       return 1;//Andu: TODO our error code or what?
-  if ( (sa->ss_family == AF_INET && na != sizeof(sockaddr_in)) || 
-  (sa->ss_family == AF_INET6 && na != sizeof(sockaddr_in6)) )
+  if ( (sa->ss_family == AF_INET && na != sizeof(sockaddr_in)) 
+#if HAVE_IPV6
+   || (sa->ss_family == AF_INET6 && na != sizeof(sockaddr_in6)) 
+#endif
+)
      return 1;//Andu: TODO our error code or what?
 #ifndef DO_NOT_USE_SSL
   sslMethod = SSLv23_client_method();

Modified: trunk/myserver/src/connections_scheduler/listen_threads.cpp
===================================================================
--- trunk/myserver/src/connections_scheduler/listen_threads.cpp 2008-09-03 
21:24:01 UTC (rev 2785)
+++ trunk/myserver/src/connections_scheduler/listen_threads.cpp 2008-09-04 
21:56:24 UTC (rev 2786)
@@ -23,7 +23,7 @@
 extern "C"
 {
 #ifdef WIN32
-#include <Ws2tcpip.h>
+  //#include <Ws2tcpip.h>
 #include <direct.h>
 #endif
 #ifdef NOT_WIN

Modified: trunk/myserver/src/server/server.cpp
===================================================================
--- trunk/myserver/src/server/server.cpp        2008-09-03 21:24:01 UTC (rev 
2785)
+++ trunk/myserver/src/server/server.cpp        2008-09-04 21:56:24 UTC (rev 
2786)
@@ -38,7 +38,7 @@
 extern "C" 
 {
 #ifdef WIN32
-#include <Ws2tcpip.h>
+  //#include <Ws2tcpip.h>
 #include <direct.h>
 #endif
 #ifdef NOT_WIN
@@ -66,7 +66,9 @@
 #define MAKEWORD(a, b) ((WORD) (((BYTE) (a)) | ((WORD) ((BYTE) (b))) << 8))
 #endif
 
+#if HAVE_IPV6
 const struct in6_addr in6addr_any = IN6ADDR_ANY_INIT;
+#endif
 
 /*!
  *At startup the server instance is null.
@@ -1139,16 +1141,19 @@
   /* Port used by the client.  */
     if ( asockIn->ss_family == AF_INET )
       port = ntohs(((sockaddr_in *)(asockIn))->sin_port);
+#if HAVE_IPV6
   else
     port = ntohs(((sockaddr_in6 *)(asockIn))->sin6_port);
+#endif
 
   /* Port used by the server. */
-    if ( localSockIn.ss_family == AF_INET )
+  if ( localSockIn.ss_family == AF_INET )
       myPort = ntohs(((sockaddr_in *)(&localSockIn))->sin_port);
+#if HAVE_IPV6
   else
     myPort = ntohs(((sockaddr_in6 *)(&localSockIn))->sin6_port);
+#endif
 
-
   if(!addConnectionToList(&s, asockIn, &ip[0], &localIp[0], port, myPort, 1))
   {
     /* If we report error to add the connection to the thread.  */

Modified: trunk/myserver/tests/Makefile.am
===================================================================
--- trunk/myserver/tests/Makefile.am    2008-09-03 21:24:01 UTC (rev 2785)
+++ trunk/myserver/tests/Makefile.am    2008-09-04 21:56:24 UTC (rev 2786)
@@ -3,4 +3,4 @@
 
 bin_PROGRAMS = tests_suite
 tests_suite_SOURCES = main.cpp test_base64.cpp test_connection.cpp 
test_files_utility.cpp test_filter_chain.cpp test_ftp.cpp test_gzip.cpp 
test_hashmap.cpp test_homedir.cpp test_http_request.cpp test_http_response.cpp 
test_md5.cpp test_mem_buff.cpp test_multicast.cpp test_mutex.cpp 
test_recursive_mutex.cpp test_regex.cpp test_pipe.cpp test_safetime.cpp 
test_semaphore.cpp test_thread.cpp test_utility.cpp 
-tests_suite_LDADD = ../src/libmyserver.a $(CPPUNIT_LIBS) $(PTHREAD_LIB) 
$(IDN_LIB) $(XNET_LIB) $(EVENT_LIB) $(DL_LIB) $(OPENSSL_LIB) $(ZLIB_LIB) 
$(XML_LIBS)
+tests_suite_LDADD = ../src/libmyserver.a $(CPPUNIT_LDFLAGS) $(PTHREAD_LIB) 
$(IDN_LIB) $(XNET_LIB) $(EVENT_LIB) $(DL_LIB) $(OPENSSL_LIB) $(ZLIB_LIB) 
$(XML_LIBS) $(LDFLAGS)

Modified: trunk/myserver/tests/test_mutex.cpp
===================================================================
--- trunk/myserver/tests/test_mutex.cpp 2008-09-03 21:24:01 UTC (rev 2785)
+++ trunk/myserver/tests/test_mutex.cpp 2008-09-04 21:56:24 UTC (rev 2786)
@@ -38,7 +38,7 @@
 };
 
 #ifdef WIN32
-unsigned int __stdcall test_mutex_incremented(void* pParam)
+unsigned int __stdcall test_mutex_incrementer(void* pParam)
 #endif
 #ifdef HAVE_PTHREAD
 void* test_mutex_incrementer(void* pParam)






reply via email to

[Prev in Thread] Current Thread [Next in Thread]