myserver-commit
[Top][All Lists]
Advanced

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

[myserver-commit] [3053] Detect the mingw32 build target automatically.


From: Giuseppe Scrivano
Subject: [myserver-commit] [3053] Detect the mingw32 build target automatically.
Date: Sun, 19 Apr 2009 14:20:35 +0000

Revision: 3053
          http://svn.sv.gnu.org/viewvc/?view=rev&root=myserver&revision=3053
Author:   gscrivano
Date:     2009-04-19 14:20:31 +0000 (Sun, 19 Apr 2009)
Log Message:
-----------
Detect the mingw32 build target automatically.

Modified Paths:
--------------
    trunk/myserver/configure.in
    trunk/myserver/include/base/regex/myserver_regex.h
    trunk/myserver/include/connection/connection.h
    trunk/myserver/src/base/base64/mime_utils.cpp
    trunk/myserver/src/base/file/files_utility.cpp
    trunk/myserver/stdafx.h

Modified: trunk/myserver/configure.in
===================================================================
--- trunk/myserver/configure.in 2009-04-13 14:34:44 UTC (rev 3052)
+++ trunk/myserver/configure.in 2009-04-19 14:20:31 UTC (rev 3053)
@@ -64,8 +64,6 @@
 
 AC_ARG_ENABLE([ipv6], [  --enable-ipv6 Build with IPv6 support], 
enable_ipv6="yes", enable_ipv6="")
 
-AC_ARG_ENABLE([mingw32], [ --enable-mingw32 Enable mingw32], 
enable_mingw32="yes", enable_mingw32="")
-
 root_bindir='${root_prefix}/bin'
 root_sbindir='${root_prefix}/sbin'
 root_sysconfdir='${root_prefix}/etc'
@@ -98,15 +96,44 @@
 
 AC_CHECK_FUNCS(snprintf, AC_DEFINE(SNPRINTF, 1, [Define if the snprintf 
function is present]) )
 
-dnl Looking for pthreads
-GNOME_PTHREAD_CHECK
-if test x$PTHREAD_LIB = x  -a "x$enable_mingw32" != "xyes"; then
-   AC_MSG_ERROR([
-*** This system appears to have no posix threads
-*** Threads are required for MyServer
-])
-fi
 
+case "${host}" in
+    *-*-mingw32*)
+     LDFLAGS="$LDFLAGS -lwsock32 -lgdi32 -lole32  -luuid -luserenv"
+     ;;
+  *)
+     dnl Looking for pthreads
+     GNOME_PTHREAD_CHECK
+     if test x$PTHREAD_LIB = x; then
+             AC_MSG_ERROR([
+             *** This system appears to have no posix threads
+             *** Threads are required for MyServer
+             ])
+    fi
+
+    dnl Looking for dl
+    AC_SEARCH_LIBS([dlopen], [dl c], have_dl=yes)
+
+    if test x$have_dl == xyes; then
+        AC_DEFINE(HAVE_DL, 1, [LibDL support, define to 1 to enable])
+        MAKE_MSCGI=yes
+    else
+         AC_MSG_WARN([
+                *** dlLIB not found
+                *** MSCGI support will not function
+                    ])
+         DL_LIB=""
+         MAKE_MSCGI=no
+   fi
+
+
+  ;;
+
+esac
+
+AC_SUBST(DL_LIB)
+
+
 if test x$PTHREAD_LIB != x; then
    AC_DEFINE(HAVE_PTHREAD, 1, [POSIX threads required for MyServer in a 
non-windows environment])
 fi
@@ -120,22 +147,17 @@
 fi
 AC_SUBST(XNET_LIB)
 
-AC_CHECK_LIB(event, event_add, have_event=yes)
+AC_SEARCH_LIBS([event_add], [event event_core event_extra],  have_event=yes)
+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=""
 
-   if test "x$enable_mingw32" != "xyes"; then
-      AC_MSG_ERROR([
+   AC_MSG_ERROR([
 *** This system appears to have no libevent
 *** Libevent is required by MyServer
       ])
-   fi
 fi
 AC_SUBST(EVENT_LIB)
 
@@ -150,34 +172,7 @@
          [AC_MSG_RESULT(no)
           AC_DEFINE(socklen_t, int, need to define this where socklen_t is not 
present)])
 
-dnl Looking for dl
-AC_CHECK_LIB(dl ,dlopen, have_dl=yes)
-AC_CHECK_LIB(c ,dlopen, have_dl=yes; no_dl_ld=yes)
 
-if test x$have_dl != xyes; then
-
-   if test "x$enable_mingw32" != "xyes"; then
-      AC_MSG_WARN([
-*** dlLIB not found
-*** MSCGI support will not function
-    ])
-    fi
-
-   DL_LIB=""
-   MAKE_MSCGI=no
-else
-   AC_DEFINE(HAVE_DL, 1, [LibDL support, define to 1 to enable])
-   DL_LIB="-ldl"
-   MAKE_MSCGI=yes
-fi
-if test x$no_dl_ld = xyes; then
-   DL_LIB=""
-fi
-
-
-AC_SUBST(DL_LIB)
-
-
 # Libidn checks
 # -------------
 AC_CHECK_HEADER(idna.h,, 
@@ -301,9 +296,7 @@
     CPPUNIT_LDFLAGS="-lcppunit"
 fi
 
-if test "x$enable_mingw32" = "xyes"; then
-   LDFLAGS="$LDFLAGS -levent_extra -levent_core  -lws2_32 -lgdi32 -lrx 
-luserenv -lole32  -luuid -ly" 
-fi
+LDFLAGS="$LDFLAGS $LIBS"
 
 AC_SUBST(CFLAGS)
 AC_SUBST(CXFLAGS)

Modified: trunk/myserver/include/base/regex/myserver_regex.h
===================================================================
--- trunk/myserver/include/base/regex/myserver_regex.h  2009-04-13 14:34:44 UTC 
(rev 3052)
+++ trunk/myserver/include/base/regex/myserver_regex.h  2009-04-19 14:20:31 UTC 
(rev 3053)
@@ -1,7 +1,7 @@
 /* -*- mode: c++ -*- */
 /*
 MyServer
-Copyright (C) 2002, 2003, 2004, 2007, 2008 Free Software Foundation, Inc.
+Copyright (C) 2002, 2003, 2004, 2007, 2008, 2009 Free Software Foundation, Inc.
 This program is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation; either version 3 of the License, or
@@ -21,10 +21,6 @@
 
 #include "stdafx.h"
 
-#ifdef WIN32
-#define REGEX
-#endif
-
 #ifndef _VC
 extern "C" 
 {
@@ -32,9 +28,7 @@
 
 #include <stdio.h>
 
-#ifdef WIN32
-#include <rxposix.h>
-#elif REGEX
+#ifdef REGEX
 #include <regex.h>
 #else
        typedef void* regmatch_t;

Modified: trunk/myserver/include/connection/connection.h
===================================================================
--- trunk/myserver/include/connection/connection.h      2009-04-13 14:34:44 UTC 
(rev 3052)
+++ trunk/myserver/include/connection/connection.h      2009-04-19 14:20:31 UTC 
(rev 3053)
@@ -1,7 +1,7 @@
 /* -*- mode: c++ -*- */
 /*
 MyServer
-Copyright (C) 2002, 2003, 2004, 2007, 2008 Free Software Foundation, Inc.
+Copyright (C) 2002, 2003, 2004, 2007, 2008, 2009 Free Software Foundation, Inc.
 This program is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation; either version 3 of the License, or
@@ -22,7 +22,6 @@
 extern "C"
 {
 #include <sys/time.h>
-#include <sys/types.h>
 }
 
 #include <include/base/socket/socket.h>

Modified: trunk/myserver/src/base/base64/mime_utils.cpp
===================================================================
--- trunk/myserver/src/base/base64/mime_utils.cpp       2009-04-13 14:34:44 UTC 
(rev 3052)
+++ trunk/myserver/src/base/base64/mime_utils.cpp       2009-04-19 14:20:31 UTC 
(rev 3053)
@@ -19,15 +19,16 @@
 #include <include/base/base64/mime_utils.h>
 #include <include/base/string/stringutils.h>
 #include <include/base/string/securestr.h>
+
 extern "C" 
 {
-#ifndef WIN32
 #include <stdio.h>
-#include <ctype.h>
-#endif
-
 #include <stdlib.h>
 #include <string.h>
+
+#ifndef WIN32
+#include <ctype.h>
+#endif
 }
 
 #define strupos(x, y) (strustr(x, y) != NULL ? strustr(x, y) - x : -1) //char 
version
@@ -569,11 +570,9 @@
         LineLen = 0;
       }
       finalresult = expandBuffer(finalresult, UsedSize, &BufSize, 0);
-#ifdef WIN32
-      itoa(mid, mids, 16);
-#else
+
       snprintf(mids, 3, "%X", mid);
-#endif
+
       strupr(mids);
       *(fresult++) = '=';
       *(fresult++) = mids[0];

Modified: trunk/myserver/src/base/file/files_utility.cpp
===================================================================
--- trunk/myserver/src/base/file/files_utility.cpp      2009-04-13 14:34:44 UTC 
(rev 3052)
+++ trunk/myserver/src/base/file/files_utility.cpp      2009-04-19 14:20:31 UTC 
(rev 3053)
@@ -21,12 +21,17 @@
 #include <include/base/utility.h>
 #include <include/base/string/stringutils.h>
 
+extern "C"
+{
+#include <sys/stat.h>
+}
+
 #ifndef WIN32
-extern "C" {
+extern "C"
+{
 #include <fcntl.h>
 #include <unistd.h>
 #include <sys/types.h>
-#include <sys/stat.h>
 #include <errno.h>
 #include <stdio.h>
 #include <fcntl.h>

Modified: trunk/myserver/stdafx.h
===================================================================
--- trunk/myserver/stdafx.h     2009-04-13 14:34:44 UTC (rev 3052)
+++ trunk/myserver/stdafx.h     2009-04-19 14:20:31 UTC (rev 3053)
@@ -31,31 +31,30 @@
 #include <pthread.h>
 #endif
 
+#ifdef WIN32
+extern "C"
+{
+#include <winsock2.h>
+#include <tchar.h>
+#include <process.h>
+}
+#endif
 
+
 extern "C" {
+#include <stdlib.h>
 #include <stdio.h>
 #include <fcntl.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <stdlib.h>
 #include <math.h>
 #include <time.h>
 
 #ifndef WIN32
+#include <sys/types.h>
+#include <sys/stat.h>
 #include <limits.h>
 #endif
 }
 
-#ifdef WIN32
-extern "C"
-{
-#include <winsock2.h>
-#include <tchar.h>
-#include <process.h>
-#include <io.h>
-}
-#endif
-
 #ifndef MAX_PATH
 #ifdef PATH_MAX
 #define MAX_PATH PATH_MAX





reply via email to

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