This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

I have installed cygwin under GNU/Linux + Wine, but the file i/o is so slow.


Hello all,

Recently, I try to install cygwin under GNU/Linux + Wine.
But all version of setup.exe failed.

My system software list:
linux-kernel-2.6.25.7
binutils-2.18
glibc-2.7
gcc-4.3.1
xorg-7.3
wine-1.1.2

So I port setup.exe with winelib, it work fine.
After install cygwin under wine,
I try to run "tar -xvf linux-2.6.25.7.tar.bz2".
It spent about 20 minutes.

How to improve the file i/o performance?

Here's the source:
http://cygwin.com/setup/current/setup-2.573.2.2.tar.bz2

Here's the patch:
========================
diff -dur setup-2.573.2.2-orig/archive_tar.cc setup-2.573.2.2/archive_tar.cc
--- setup-2.573.2.2-orig/archive_tar.cc	2006-04-17 05:35:57.000000000 +0800
+++ setup-2.573.2.2/archive_tar.cc	2008-08-09 17:09:41.000000000 +0800
@@ -143,11 +143,13 @@
   char *c;

   if (state.header_read)
-    if (strlen (state.filename))
-      return state.filename;
-    else
-      /* End of tar */
-      return std::string();
+    {
+      if (strlen (state.filename))
+        return state.filename;
+      else
+        /* End of tar */
+        return std::string();
+    }

   int r = state.parent->read (&state.tar_header, 512);

diff -dur setup-2.573.2.2-orig/autoload.c setup-2.573.2.2/autoload.c
--- setup-2.573.2.2-orig/autoload.c	2007-02-28 08:55:04.000000000 +0800
+++ setup-2.573.2.2/autoload.c	2008-08-09 16:54:05.000000000 +0800
@@ -16,6 +16,8 @@
 static const char *cvsid = "\n%%% $Id: autoload.c,v 2.6 2007/02/28
00:55:04 briand Exp $\n";
 #endif

+#ifndef __WINE__
+
 #define WIN32_LEAN_AND_MEAN
 #include <windows.h>

@@ -94,3 +96,5 @@

   *(int *)(&x-1) = (int)proc-5;
 }
+
+#endif //__WINE__
diff -dur setup-2.573.2.2-orig/choose.cc setup-2.573.2.2/choose.cc
--- setup-2.573.2.2-orig/choose.cc	2006-04-16 20:30:07.000000000 +0800
+++ setup-2.573.2.2/choose.cc	2008-08-09 17:12:16.000000000 +0800
@@ -34,9 +34,15 @@
 #include "win32.h"
 #include <commctrl.h>
 #include <stdio.h>
-#include <io.h>
+#include <stdlib.h>
+#ifndef __WINE__
+#  include <io.h>
+#endif
 #include <ctype.h>
-#include <process.h>
+#ifndef __WINE__
+#  include <process.h>
+#endif
+#include <algorithm>

 #include "dialog.h"
 #include "resource.h"
diff -dur setup-2.573.2.2-orig/compress_bz.cc setup-2.573.2.2/compress_bz.cc
--- setup-2.573.2.2-orig/compress_bz.cc	2004-12-27 22:44:35.000000000 +0800
+++ setup-2.573.2.2/compress_bz.cc	2008-08-09 17:02:00.000000000 +0800
@@ -62,7 +62,11 @@

   if (peeklen)
   {
+  #ifndef __WINE__
     ssize_t tmplen = std::min (peeklen, len);
+  #else
+    ssize_t tmplen = min (peeklen, len);
+  #endif
     peeklen -= tmplen;
     memcpy (buffer, peekbuf, tmplen);
     memmove (peekbuf, peekbuf + tmplen, tmplen);
diff -dur setup-2.573.2.2-orig/compress_gz.cc setup-2.573.2.2/compress_gz.cc
--- setup-2.573.2.2-orig/compress_gz.cc	2004-12-27 22:44:35.000000000 +0800
+++ setup-2.573.2.2/compress_gz.cc	2008-08-09 17:12:44.000000000 +0800
@@ -23,6 +23,8 @@
 #include <stdexcept>
 using namespace std;
 #include <errno.h>
+#include <memory.h>
+#include <malloc.h>

 #define HEAD_CRC     0x02	/* bit 1 set: header CRC present */
 #define EXTRA_FIELD  0x04	/* bit 2 set: extra field present */
diff -dur setup-2.573.2.2-orig/ConnectionSetting.cc
setup-2.573.2.2/ConnectionSetting.cc
--- setup-2.573.2.2-orig/ConnectionSetting.cc	2006-04-16
05:21:25.000000000 +0800
+++ setup-2.573.2.2/ConnectionSetting.cc	2008-08-09 17:13:23.000000000 +0800
@@ -18,6 +18,7 @@
   "\n%%% $Id: ConnectionSetting.cc,v 2.5 2006/04/15 21:21:25 maxb Exp $\n";
 #endif

+#include <stdlib.h>
 #include "ConnectionSetting.h"
 #include "UserSettings.h"
 #include "io_stream.h"
diff -dur setup-2.573.2.2-orig/ControlAdjuster.h
setup-2.573.2.2/ControlAdjuster.h
--- setup-2.573.2.2-orig/ControlAdjuster.h	2005-05-06 05:00:32.000000000 +0800
+++ setup-2.573.2.2/ControlAdjuster.h	2008-08-09 16:54:05.000000000 +0800
@@ -46,10 +46,10 @@
 class ControlDimension
 {
   public:
-    ControlDimension(long &anInt1, long &anInt2) :
+    ControlDimension(LONG &anInt1, LONG &anInt2) :
       left(anInt1), right (anInt2){}
-    long &left;
-    long &right;
+    LONG &left;
+    LONG &right;
 };

 class ControlAdjuster
diff -dur setup-2.573.2.2-orig/csu_util/MD5Sum.cc
setup-2.573.2.2/csu_util/MD5Sum.cc
--- setup-2.573.2.2-orig/csu_util/MD5Sum.cc	2004-11-23 02:15:34.000000000 +0800
+++ setup-2.573.2.2/csu_util/MD5Sum.cc	2008-08-09 17:22:13.000000000 +0800
@@ -13,6 +13,7 @@
  */

 #include "MD5Sum.h"
+#include <string.h>
 #include <stdexcept>

 namespace libmd5_rfc {
diff -dur setup-2.573.2.2-orig/desktop.cc setup-2.573.2.2/desktop.cc
--- setup-2.573.2.2-orig/desktop.cc	2007-05-05 05:56:53.000000000 +0800
+++ setup-2.573.2.2/desktop.cc	2008-08-09 16:54:05.000000000 +0800
@@ -166,7 +166,11 @@
 static void
 make_cygwin_bat ()
 {
+#ifndef __WINE__
   batname = backslash (cygpath ("/Cygwin.bat"));
+#else //__WINE__
+  batname = wine_unix_path( cygpath ("/Cygwin.bat"));
+#endif //__WINE__

   /* if the batch file exists, don't overwrite it */
   if (_access (batname.c_str(), 0) == 0)
@@ -178,9 +182,15 @@

   fprintf (bat, "@echo off\n\n");

+#ifndef __WINE__
   fprintf (bat, "%.2s\n", get_root_dir ().c_str());
   fprintf (bat, "chdir %s\n\n",
 	   replace(backslash(get_root_dir() + "/bin"), "%", "%%").c_str());
+#else //__WINE__
+  fprintf (bat, "%.2s\n", (wine_dos_path (get_root_dir ())).c_str());
+  fprintf (bat, "chdir %s\n\n",
+	   replace(backslash(wine_dos_path (get_root_dir ()) + "/bin"), "%",
"%%").c_str());
+#endif //__WINE__

   fprintf (bat, "bash --login -i\n");

@@ -190,7 +200,11 @@
 static void
 save_icon ()
 {
+#ifndef __WINE__
   iconname = backslash (cygpath ("/Cygwin.ico"));
+#else //__WINE__
+  iconname = wine_unix_path (cygpath ("/Cygwin.ico"));
+#endif //__WINE__

   HRSRC rsrc = FindResource (NULL, "CYGWIN.ICON", "FILE");
   if (rsrc == NULL)
diff -dur setup-2.573.2.2-orig/download.cc setup-2.573.2.2/download.cc
--- setup-2.573.2.2-orig/download.cc	2007-05-05 05:56:53.000000000 +0800
+++ setup-2.573.2.2/download.cc	2008-08-09 16:54:05.000000000 +0800
@@ -29,7 +29,9 @@

 #include <stdio.h>
 #include <unistd.h>
-#include <process.h>
+#ifndef __WINE__
+#  include <process.h>
+#endif

 #include "resource.h"
 #include "msg.h"
diff -dur setup-2.573.2.2-orig/filemanip.cc setup-2.573.2.2/filemanip.cc
--- setup-2.573.2.2-orig/filemanip.cc	2006-04-16 05:21:25.000000000 +0800
+++ setup-2.573.2.2/filemanip.cc	2008-08-09 17:14:55.000000000 +0800
@@ -21,9 +21,13 @@
   "\n%%% $Id: filemanip.cc,v 2.18 2006/04/15 21:21:25 maxb Exp $\n";
 #endif

+#include <string.h>
 #include "filemanip.h"
 #include "io_stream.h"
 #include "String++.h"
+#ifdef __WINE__
+#  include "mount.h"
+#endif

 using namespace std;

@@ -105,21 +109,27 @@
     }
   for (ver = p; *ver; ver++)
     if (*ver == '-')
-      if (isdigit (ver[1]))
-	{
-	  *ver++ = 0;
-	  f.pkg = p;
-	  break;
-	}
-      else if (strcasecmp (ver, "-src") == 0 ||
-	       strcasecmp (ver, "-patch") == 0)
-	{
-	  *ver++ = 0;
-	  f.pkg = p;
-	  f.what = strlwr (ver);
-	  ver = strchr (ver, '\0');
-	  break;
-	}
+      {
+        if (isdigit (ver[1]))
+          {
+            *ver++ = 0;
+            f.pkg = p;
+            break;
+          }
+        else if (strcasecmp (ver, "-src") == 0 ||
+  	         strcasecmp (ver, "-patch") == 0)
+  	  {
+            *ver++ = 0;
+            f.pkg = p;
+       #ifndef __WINE__
+            f.what = strlwr (ver);
+       #else  //__WINE__
+            f.what = ver; //FIXME
+       #endif //__WINE__
+            ver = strchr (ver, '\0');
+            break;
+  	  }
+      }

   if (!f.pkg.size())
     f.pkg = p;
@@ -162,7 +172,11 @@
 std::string
 backslash(const std::string& s)
 {
+#ifndef __WINE__
   std::string rv(s);
+#else
+  std::string rv(wine_dos_path(s));
+#endif

   for (std::string::iterator it = rv.begin(); it != rv.end(); ++it)
     if (*it == '/')
diff -dur setup-2.573.2.2-orig/ini.cc setup-2.573.2.2/ini.cc
--- setup-2.573.2.2-orig/ini.cc	2007-05-30 11:49:48.000000000 +0800
+++ setup-2.573.2.2/ini.cc	2008-08-09 16:54:05.000000000 +0800
@@ -35,8 +35,9 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <stdarg.h>
-#include <process.h>
-
+#ifndef __WINE__
+#  include <process.h>
+#endif
 #include "resource.h"
 #include "state.h"
 #include "geturl.h"
diff -dur setup-2.573.2.2-orig/install.cc setup-2.573.2.2/install.cc
--- setup-2.573.2.2-orig/install.cc	2007-06-27 16:18:43.000000000 +0800
+++ setup-2.573.2.2/install.cc	2008-08-09 16:54:05.000000000 +0800
@@ -37,7 +37,9 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <errno.h>
-#include <process.h>
+#ifndef __WINE__
+#  include <process.h>
+#endif

 #include "resource.h"
 #include "dialog.h"
diff -dur setup-2.573.2.2-orig/io_stream_cygfile.cc
setup-2.573.2.2/io_stream_cygfile.cc
--- setup-2.573.2.2-orig/io_stream_cygfile.cc	2006-04-17
05:35:57.000000000 +0800
+++ setup-2.573.2.2/io_stream_cygfile.cc	2008-08-09 16:54:05.000000000 +0800
@@ -207,7 +207,11 @@
     case IO_STREAM_SYMLINK:
       // symlinks are arbitrary targets, can be anything, and are
       // not subject to translation
+    #ifndef __WINE__
       return mkcygsymlink (cygpath (from).c_str(), _to.c_str());
+    #else //__WINE__
+      return symlink (_to.c_str(), wine_unix_path(cygpath (from)).c_str());
+    #endif //__WINE__
     case IO_STREAM_HARDLINK:
       {
 	/* For now, just copy */
diff -dur setup-2.573.2.2-orig/io_stream_file.cc
setup-2.573.2.2/io_stream_file.cc
--- setup-2.573.2.2-orig/io_stream_file.cc	2006-04-17 05:35:57.000000000 +0800
+++ setup-2.573.2.2/io_stream_file.cc	2008-08-09 16:54:05.000000000 +0800
@@ -141,7 +141,7 @@
 {
   if (!from.size() || !to.size())
     return 1;
-#if defined(WIN32) && !defined (_CYGWIN_)
+#if defined(WIN32) && !defined (_CYGWIN_) && !defined (__WINE__)
   switch (linktype)
     {
     case IO_STREAM_SYMLINK:
diff -dur setup-2.573.2.2-orig/io_stream.h setup-2.573.2.2/io_stream.h
--- setup-2.573.2.2-orig/io_stream.h	2006-04-17 05:35:57.000000000 +0800
+++ setup-2.573.2.2/io_stream.h	2008-08-09 16:54:05.000000000 +0800
@@ -33,7 +33,7 @@
  */

 //Where is this defined?
-#if defined(_WIN32) && ! defined(__CYGWIN__)
+#if defined(_WIN32) && ! defined(__CYGWIN__) && ! defined(__WINE__)
 typedef signed long ssize_t;
 #endif

diff -dur setup-2.573.2.2-orig/libgetopt++/src/OptionSet.cc
setup-2.573.2.2/libgetopt++/src/OptionSet.cc
--- setup-2.573.2.2-orig/libgetopt++/src/OptionSet.cc	2003-12-11
04:51:44.000000000 +0800
+++ setup-2.573.2.2/libgetopt++/src/OptionSet.cc	2008-08-09
17:10:21.000000000 +0800
@@ -23,6 +23,10 @@

 #include <iostream>

+#ifdef __WINE__
+#include <algorithm>
+#endif
+
 using namespace std;

 bool
diff -dur setup-2.573.2.2-orig/localdir.cc setup-2.573.2.2/localdir.cc
--- setup-2.573.2.2-orig/localdir.cc	2006-04-16 05:21:25.000000000 +0800
+++ setup-2.573.2.2/localdir.cc	2008-08-09 16:54:05.000000000 +0800
@@ -76,6 +76,11 @@
     }
   if (((std::string)LocalDirOption).size())
     local_dir = ((std::string)LocalDirOption);
+
+#ifdef __WINE__
+  local_dir = wine_unix_path (local_dir);
+#endif
+
   inited = 1;
 }

@@ -85,7 +90,12 @@
   io_stream *f = UserSettings::Instance().settingFileForSave("last-cache");
   if (f)
     {
+    #ifndef __WINE__
       f->write (local_dir.c_str(), local_dir.size());
+    #else //__WINE__
+      std::string s = wine_dos_path (local_dir);
+      f->write (s.c_str(), s.size());
+    #endif //__WINE__
       delete f;
     }
   if (source == IDC_SOURCE_DOWNLOAD || !get_root_dir ().size())
@@ -111,14 +121,23 @@
 static void
 load_dialog (HWND h)
 {
+#ifndef __WINE__
   eset (h, IDC_LOCAL_DIR, local_dir);
+#else //__WINE__
+  eset (h, IDC_LOCAL_DIR, wine_dos_path(local_dir));
+#endif //__WINE__
+
   check_if_enable_next (h);
 }

 static void
 save_dialog (HWND h)
 {
+#ifndef __WINE__
   local_dir = egetString (h, IDC_LOCAL_DIR);
+#else //__WINE__
+  local_dir = wine_unix_path (egetString (h, IDC_LOCAL_DIR));
+#endif //__WINE__
 }


diff -dur setup-2.573.2.2-orig/LogFile.cc setup-2.573.2.2/LogFile.cc
--- setup-2.573.2.2-orig/LogFile.cc	2007-03-31 06:18:34.000000000 +0800
+++ setup-2.573.2.2/LogFile.cc	2008-08-09 17:15:52.000000000 +0800
@@ -20,6 +20,7 @@
   "\n%%% $Id: LogFile.cc,v 2.16 2007/03/30 22:18:34 igor Exp $\n";
 #endif

+#include <stdlib.h>
 #include "LogFile.h"
 #include "io_stream.h"
 #include "win32.h"
diff -dur setup-2.573.2.2-orig/main.cc setup-2.573.2.2/main.cc
--- setup-2.573.2.2-orig/main.cc	2007-02-28 08:55:04.000000000 +0800
+++ setup-2.573.2.2/main.cc	2008-08-09 16:54:05.000000000 +0800
@@ -31,6 +31,10 @@
   "\n%%% $Id: main.cc,v 2.44 2007/02/28 00:55:04 briand Exp $\n";
 #endif

+#ifdef __WINE__
+  #include <errno.h>
+#endif
+
 #include "win32.h"
 #include <commctrl.h>

@@ -83,7 +87,7 @@
 // so we make the actual logger available to the appropriate routine(s).
 LogFile *theLog;

-#ifndef __CYGWIN__
+#if ! defined(__CYGWIN__) && ! defined(__WINE__)
 int WINAPI
 WinMain (HINSTANCE h,
 	 HINSTANCE hPrevInstance, LPSTR command_line, int cmd_show)
@@ -104,7 +108,7 @@

     // TODO: make an equivalent for __argv under cygwin.
     char **_argv;
-#ifndef __CYGWIN__
+#if ! defined(__CYGWIN__) && ! defined(__WINE__)
     int argc;
     for (argc = 0, _argv = __argv; *_argv; _argv++)
       ++argc;
@@ -125,9 +129,11 @@

     // Ensure files created by postinstall and preremove scripts
     // get sane permissions.
+#ifndef __WINE__ //FIXME
     if (putenv ("CYGWIN=nontsec") != 0)
       log (LOG_PLAIN) << "Failed to set CYGWIN=nontsec (errno " << errno
             << ": " << strerror(errno) << ")" << endLog;
+#endif //__WINE__

     UserSettings::Instance ().loadAllSettings ();

diff -dur setup-2.573.2.2-orig/Makefile.am setup-2.573.2.2/Makefile.am
--- setup-2.573.2.2-orig/Makefile.am	2007-06-27 16:18:43.000000000 +0800
+++ setup-2.573.2.2/Makefile.am	2008-08-09 21:28:31.000000000 +0800
@@ -115,8 +115,7 @@
 setup_LDADD = \
 	libinilex.a libgetopt++/libgetopt++.la \
 	res.o \
-	/usr/lib/mingw/libbz2.a /usr/lib/mingw/libz.a \
-	-lcomctl32 -lole32 -lwsock32 -lnetapi32 -luuid
+	-lcomctl32 -lole32 -lwsock32 -lnetapi32 -luuid -lbz2 -lz
 setup_LDFLAGS = -mwindows
 setup_SOURCES = \
 	AntiVirus.cc \
diff -dur setup-2.573.2.2-orig/Makefile.in setup-2.573.2.2/Makefile.in
--- setup-2.573.2.2-orig/Makefile.in	2007-06-27 16:19:01.000000000 +0800
+++ setup-2.573.2.2/Makefile.in	2008-08-09 21:36:10.000000000 +0800
@@ -126,8 +126,7 @@
 	csu_util/MD5Sum.$(OBJEXT) csu_util/rfc1738.$(OBJEXT) \
 	csu_util/version_compare.$(OBJEXT) libmd5-rfc/md5.$(OBJEXT)
 setup_OBJECTS = $(am_setup_OBJECTS)
-setup_DEPENDENCIES = libinilex.a libgetopt++/libgetopt++.la res.o \
-	/usr/lib/mingw/libbz2.a /usr/lib/mingw/libz.a
+setup_DEPENDENCIES = libinilex.a libgetopt++/libgetopt++.la res.o
 setup_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
 	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) \
 	$(setup_LDFLAGS) $(LDFLAGS) -o $@
@@ -246,7 +245,7 @@
 SHELL = @SHELL@
 STRIP = @STRIP@
 VERSION = @VERSION@
-WINDRES := @WINDRES@
+WINDRES = @WINDRES@
 YACC = @YACC@
 YFLAGS = @YFLAGS@
 abs_builddir = @abs_builddir@
@@ -390,8 +389,7 @@
 setup_LDADD = \
 	libinilex.a libgetopt++/libgetopt++.la \
 	res.o \
-	/usr/lib/mingw/libbz2.a /usr/lib/mingw/libz.a \
-	-lcomctl32 -lole32 -lwsock32 -lnetapi32 -luuid
+	-lcomctl32 -lole32 -lwsock32 -lnetapi32 -luuid -lbz2 -lz

 setup_LDFLAGS = -mwindows
 setup_SOURCES = \
diff -dur setup-2.573.2.2-orig/mklink2.cc setup-2.573.2.2/mklink2.cc
--- setup-2.573.2.2-orig/mklink2.cc	2004-12-26 07:05:57.000000000 +0800
+++ setup-2.573.2.2/mklink2.cc	2008-08-09 16:54:05.000000000 +0800
@@ -45,7 +45,7 @@
 mkcygsymlink (const char *from, const char *to)
 {
   char buf[512];
-  unsigned long w;
+  unsigned int w;
   HANDLE h = CreateFileA (from, GENERIC_WRITE, 0, 0, CREATE_NEW,
 		   FILE_ATTRIBUTE_NORMAL, 0);
   if (h == INVALID_HANDLE_VALUE)
diff -dur setup-2.573.2.2-orig/mount.cc setup-2.573.2.2/mount.cc
--- setup-2.573.2.2-orig/mount.cc	2007-02-28 08:55:04.000000000 +0800
+++ setup-2.573.2.2/mount.cc	2008-08-09 16:54:05.000000000 +0800
@@ -97,6 +97,39 @@

 struct mnt *root_here = NULL;

+#ifdef __WINE__
+#  include <winbase.h>
+
+std::string
+wine_unix_path(const std::string& s)
+{
+  if (s.empty())
+    return std::string ();
+  if (s.c_str()[0] == '/')
+    return std::string (s);
+
+  WCHAR wtmp[4000];
+  memset (wtmp, 0, sizeof (wtmp));
+  MultiByteToWideChar(CP_ACP, 0, s.c_str(), -1, wtmp, 4000);
+  return std::string (wine_get_unix_file_name (wtmp));
+}
+
+std::string
+wine_dos_path(const std::string& s)
+{
+  if (s.empty())
+    return std::string ();
+  if (s.c_str()[0] != '/')
+    return std::string (s);
+
+
+  char tmp[4000];
+  memset (tmp, 0, sizeof (tmp));
+  WideCharToMultiByte(CP_ACP, 0, wine_get_dos_file_name (s.c_str()),
-1, tmp, 4000, NULL, NULL);
+  return std::string (tmp);
+}
+#endif //__WINE__
+
 static std::string
 find2 (HKEY rkey, int *istext, const std::string& what)
 {
@@ -155,8 +188,15 @@
   if (rv != ERROR_SUCCESS)
     fatal ("mount", rv);

+#ifndef __WINE__
   RegSetValueEx (key, "native", 0, REG_SZ, (BYTE *) win32.c_str (),
 		 win32.size () + 1);
+#else
+  std::string wine_win32 = wine_dos_path (win32);
+  RegSetValueEx (key, "native", 0, REG_SZ, (BYTE *) wine_win32.c_str (),
+		 wine_win32.size () + 1);
+#endif
+
   flags = 0;
   if (!istext)
     flags |= MOUNT_BINARY;
@@ -445,7 +485,11 @@
 void
 set_root_dir (const std::string val)
 {
+#ifndef __WINE__
   root_here->native = val;
+#else //__WINE__
+  root_here->native = wine_unix_path (val);
+#endif //__WINE__
 }

 const std::string
diff -dur setup-2.573.2.2-orig/mount.h setup-2.573.2.2/mount.h
--- setup-2.573.2.2-orig/mount.h	2006-04-16 23:37:49.000000000 +0800
+++ setup-2.573.2.2/mount.h	2008-08-09 16:54:05.000000000 +0800
@@ -23,6 +23,11 @@
 #include <string>
 #include "String++.h"

+#ifdef __WINE__
+std::string wine_unix_path(const std::string& s);
+std::string wine_dos_path(const std::string& s);
+#endif //__WINE__
+
 char *find_mount (int *istext, int *issystem, char *path);

 /* Similar to the mount and umount functions, but simplified */
diff -dur setup-2.573.2.2-orig/netio.cc setup-2.573.2.2/netio.cc
--- setup-2.573.2.2-orig/netio.cc	2005-05-04 22:52:34.000000000 +0800
+++ setup-2.573.2.2/netio.cc	2008-08-09 16:54:05.000000000 +0800
@@ -233,7 +233,7 @@
   return 0;
 }

-static BOOL CALLBACK
+static INT_PTR CALLBACK
 auth_proc (HWND h, UINT message, WPARAM wParam, LPARAM lParam)
 {
   switch (message)
diff -dur setup-2.573.2.2-orig/nio-ftp.cc setup-2.573.2.2/nio-ftp.cc
--- setup-2.573.2.2-orig/nio-ftp.cc	2005-10-14 11:55:42.000000000 +0800
+++ setup-2.573.2.2/nio-ftp.cc	2008-08-09 17:17:09.000000000 +0800
@@ -64,7 +64,7 @@
     port = 21;

 control_reconnect:
-  if (cmd_host && strcmp (host, cmd_host) != 0 || port != cmd_port)
+  if ((cmd_host && strcmp (host, cmd_host) != 0) || port != cmd_port)
     {
       if (cmd)
 	cmd->printf ("QUIT\r\n");
diff -dur setup-2.573.2.2-orig/nio-http.cc setup-2.573.2.2/nio-http.cc
--- setup-2.573.2.2-orig/nio-http.cc	2006-04-16 05:21:25.000000000 +0800
+++ setup-2.573.2.2/nio-http.cc	2008-08-09 16:54:05.000000000 +0800
@@ -34,9 +34,15 @@
 #include "netio.h"
 #include "nio-http.h"

-#ifndef _strnicmp
-#define _strnicmp strncasecmp
-#endif
+#ifndef __WINE__
+#  ifndef _strnicmp
+#    define _strnicmp strncasecmp
+#  endif
+#else //__WINE__
+#  ifndef _strncasecmp
+#    define _strncasecmp strncasecmp
+#  endif
+#endif //__WINE__

 static char six2pr[64] = {
   'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',
@@ -143,6 +149,7 @@
     {
       while ((l = s->gets ()) != 0)
 	{
+     #ifndef __WINE__
 	  if (_strnicmp (l, "Location:", 9) == 0)
 	    {
 	      char *
@@ -154,6 +161,19 @@
 		s;
 	      goto retry_get;
 	    }
+     #else //__WINE__
+	  if (_strncasecmp (l, "Location:", 9) == 0)
+	    {
+	      char *
+		u = l + 9;
+	      while (*u == ' ' || *u == '\t')
+		u++;
+	      set_url (u);
+	      delete
+		s;
+	      goto retry_get;
+	    }
+     #endif //__WINE__
 	}
     }
   if (code == 401)		/* authorization required */
@@ -194,8 +214,13 @@
   // Eat the header, picking out the Content-Length in the process
   while (((l = s->gets ()) != NULL) && (*l != '\0'))
     {
+    #ifndef __WINE__
       if (_strnicmp (l, "Content-Length:", 15) == 0)
 	sscanf (l, "%*s %d", &file_size);
+    #else
+      if (_strncasecmp (l, "Content-Length:", 15) == 0)
+	sscanf (l, "%*s %d", &file_size);
+    #endif
     }
 }

diff -dur setup-2.573.2.2-orig/package_db.cc setup-2.573.2.2/package_db.cc
--- setup-2.573.2.2-orig/package_db.cc	2006-08-07 06:09:26.000000000 +0800
+++ setup-2.573.2.2/package_db.cc	2008-08-09 17:17:42.000000000 +0800
@@ -26,6 +26,7 @@
 #include <stdlib.h>
 #include <unistd.h>
 #include <strings.h>
+#include <algorithm>
 #if HAVE_ERRNO_H
 #include <errno.h>
 #endif
diff -dur setup-2.573.2.2-orig/package_source.cc
setup-2.573.2.2/package_source.cc
--- setup-2.573.2.2-orig/package_source.cc	2006-04-18 00:13:17.000000000 +0800
+++ setup-2.573.2.2/package_source.cc	2008-08-09 16:54:05.000000000 +0800
@@ -22,6 +22,9 @@
   "\n%%% $Id: package_source.cc,v 2.10 2006/04/17 16:13:17 maxb Exp $\n";
 #endif

+#ifdef __WINE__
+#  include <string.h>
+#endif
 #include <stdlib.h>
 #include <strings.h>
 #include "package_source.h"
diff -dur setup-2.573.2.2-orig/PickView.cc setup-2.573.2.2/PickView.cc
--- setup-2.573.2.2-orig/PickView.cc	2006-05-24 21:01:34.000000000 +0800
+++ setup-2.573.2.2/PickView.cc	2008-08-09 17:19:08.000000000 +0800
@@ -14,6 +14,7 @@
  */

 #include "PickView.h"
+#include <limits.h>
 #include <commctrl.h>
 #include "PickPackageLine.h"
 #include "PickCategoryLine.h"
diff -dur setup-2.573.2.2-orig/prereq.cc setup-2.573.2.2/prereq.cc
--- setup-2.573.2.2-orig/prereq.cc	2006-04-16 05:21:25.000000000 +0800
+++ setup-2.573.2.2/prereq.cc	2008-08-09 16:54:05.000000000 +0800
@@ -21,9 +21,13 @@
 #include "win32.h"
 #include <commctrl.h>
 #include <stdio.h>
-#include <io.h>
+#ifndef __WINE__
+#  include <io.h>
+#endif
 #include <ctype.h>
-#include <process.h>
+#ifndef __WINE__
+#  include <process.h>
+#endif

 #include "prereq.h"
 #include "dialog.h"
diff -dur setup-2.573.2.2-orig/proppage.cc setup-2.573.2.2/proppage.cc
--- setup-2.573.2.2-orig/proppage.cc	2006-04-16 05:21:25.000000000 +0800
+++ setup-2.573.2.2/proppage.cc	2008-08-09 16:54:05.000000000 +0800
@@ -81,7 +81,7 @@
   return true;
 }

-BOOL CALLBACK
+INT_PTR CALLBACK
 PropertyPage::FirstDialogProcReflector (HWND hwnd, UINT message,
 					WPARAM wParam, LPARAM lParam)
 {
diff -dur setup-2.573.2.2-orig/proppage.h setup-2.573.2.2/proppage.h
--- setup-2.573.2.2-orig/proppage.h	2006-04-16 05:21:25.000000000 +0800
+++ setup-2.573.2.2/proppage.h	2008-08-09 16:54:05.000000000 +0800
@@ -42,7 +42,7 @@
   // For setting the back/finish buttons properly.
   bool IsFirst, IsLast;

-  static BOOL CALLBACK FirstDialogProcReflector (HWND hwnd, UINT message,
+  static INT_PTR CALLBACK FirstDialogProcReflector (HWND hwnd, UINT message,
 						 WPARAM wParam,
 						 LPARAM lParam);
   static BOOL CALLBACK DialogProcReflector (HWND hwnd, UINT message,
diff -dur setup-2.573.2.2-orig/propsheet.cc setup-2.573.2.2/propsheet.cc
--- setup-2.573.2.2-orig/propsheet.cc	2003-11-01 15:21:28.000000000 +0800
+++ setup-2.573.2.2/propsheet.cc	2008-08-09 16:54:05.000000000 +0800
@@ -433,8 +433,13 @@
 PropSheet::SetActivePageByID (int resource_id)
 {
   // Posts a message to the message queue, so this won't block
+#ifndef __WINE__
   return static_cast < bool >
     (::PropSheet_SetCurSelByID (GetHWND (), resource_id));
+#else
+  return static_cast < bool >
+    (PropSheet_SetCurSelByID (GetHWND (), resource_id));
+#endif
 }

 void
diff -dur setup-2.573.2.2-orig/res.rc setup-2.573.2.2/res.rc
--- setup-2.573.2.2-orig/res.rc	2007-05-05 05:56:53.000000000 +0800
+++ setup-2.573.2.2/res.rc	2008-08-09 16:54:06.000000000 +0800
@@ -1,5 +1,8 @@
 #include "resource.h"
 #include "windows.h"
+#include "winuser.h"
+#include "winnt.h"
+#include "commctrl.h"

 LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US

@@ -71,8 +74,8 @@
 BEGIN
     LTEXT           "Select Local Package Directory",IDC_STATIC_HEADER_TITLE,
                     7,0,258,8,NOT WS_GROUP
-    LTEXT           "Select a directory where you want Setup to store the "
-                    "installation files it downloads.  The directory will be "
+    LTEXT           "Select a directory where you want Setup to store the "\
+                    "installation files it downloads.  The directory will be "\
                     "created if it does not already exist.",IDC_STATIC,
                     21,9,248,16,NOT WS_GROUP
     ICON            IDI_CYGWIN,IDC_HEADICON,290,0,21,20
@@ -91,7 +94,7 @@
 BEGIN
     LTEXT           "Select Root Install Directory",IDC_STATIC_HEADER_TITLE,
                     7,0,258,8,NOT WS_GROUP
-    LTEXT           "Select the directory where you want to install Cygwin.  "
+    LTEXT           "Select the directory where you want to install Cygwin.  "\
                     "Also choose a few installation parameters.",
                     IDC_STATIC,21,9,239,16,NOT WS_GROUP
     ICON            IDI_CYGWIN,IDC_HEADICON,290,0,21,20
@@ -112,17 +115,17 @@
                     BS_AUTORADIOBUTTON | WS_TABSTOP | WS_GROUP,170,89,130,8
     CONTROL         "D&OS / text",IDC_ROOT_TEXT,"Button",BS_AUTORADIOBUTTON |
                     WS_TABSTOP,170,130,130,8
-    LTEXT           "Cygwin will be available to all users of the system.  "
-                    "NOTE: This is required if you wish to run services like "
+    LTEXT           "Cygwin will be available to all users of the system.  "\
+                    "NOTE: This is required if you wish to run services like "\
                     "sshd, etc.",IDC_ALLUSERS_TEXT,25,101,125,28
-    LTEXT           "Cygwin will only be available to the current user.  "
-                    "Only select this if you lack Admin. privileges or you "
+    LTEXT           "Cygwin will only be available to the current user.  "\
+                    "Only select this if you lack Admin. privileges or you "\
                     "have specific needs.",IDC_JUSTME_TEXT,25,140,125,32

-    LTEXT           "No line translation done; all files opened in
binary mode."
+    LTEXT           "No line translation done; all files opened in
binary mode."\
                     "  Files on disk will have LF line endings.", IDC_MODE_BIN,
                     181,101,125,27
-    LTEXT           "Line endings will be translated from unix (LF) to DOS "
+    LTEXT           "Line endings will be translated from unix (LF) to DOS "\
                     "(CR-LF) on write and vice versa on read.",IDC_MODE_TEXT,
                     181,140,125,26
     LTEXT           "Read more about file modes...",IDC_FILEMODES_LINK,
@@ -253,15 +256,15 @@
 //    CONTROL         "",IDC_STATIC,"Static",SS_WHITERECT,0,0,95,178
     LTEXT           "Cygwin Net Release Setup Program",
                     IDC_STATIC_WELCOME_TITLE,115,1,195,24
-    LTEXT           "This setup program is used for the initial installation "
-                    "of the Cygwin environment as well as all subsequent "
-                    "updates.  Make sure to remember where you saved
it.\r\n\r\n"
-                    "The pages that follow will guide you through the "
-                    "installation.  Please note that Cygwin consists of a "
-                    "large number of packages spanning a wide variety of "
-                    "purposes.  We only install a base set of packages by "
-                    "default.  You can always run this program at any time in "
-                    "the future to add, remove, or upgrade packages as "
+    LTEXT           "This setup program is used for the initial installation "\
+                    "of the Cygwin environment as well as all subsequent "\
+                    "updates.  Make sure to remember where you saved
it.\r\n\r\n"\
+                    "The pages that follow will guide you through the "\
+                    "installation.  Please note that Cygwin consists of a "\
+                    "large number of packages spanning a wide variety of "\
+                    "purposes.  We only install a base set of packages by "\
+                    "default.  You can always run this program at any
time in "\
+                    "the future to add, remove, or upgrade packages as "\
                     "necessary.",IDC_SPLASH_TEXT,115,25,195,90
     ICON            IDI_CYGWIN,IDC_SPLASH_ICON,114,114,21,20,WS_GROUP
     LTEXT           "Version (unknown)",IDC_VERSION,115,137,195,10
@@ -350,7 +353,7 @@
     ICON            IDI_CYGWIN,IDC_HEADICON,290,0,21,20
     LTEXT           "Warning!  Unmet Dependencies
Found",IDC_STATIC_HEADER_TITLE
                     ,7,0,258,8,NOT WS_GROUP
-    LTEXT           "The following packages are required but have not been "
+    LTEXT           "The following packages are required but have not been "\
                     "selected.",IDC_STATIC,21,9,239,16,NOT WS_GROUP
     CONTROL         "&Install these packages to meet dependencies
(RECOMMENDED)"
                     ,IDC_PREREQ_CHECK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,
@@ -367,16 +370,16 @@
 FONT 8, "MS Shell Dlg"
 BEGIN
     LTEXT           "Warning:",IDC_STATIC,7,8,40,8
-    LTEXT           "One or more mirrors you have selected is/are not on the"
-                    "list of official Cygwin mirrors any more. "
-                    "It/They may be out of date or missing some packages.\n"
+    LTEXT           "One or more mirrors you have selected is/are not on the"\
+                    "list of official Cygwin mirrors any more. "\
+                    "It/They may be out of date or missing some packages.\n"\
                     "This affects the following mirror(s):",
                     IDC_STATIC,47,8,263,32
     EDITTEXT        IDC_DROP_MIRRORS,7,40,303,40,WS_VSCROLL | WS_HSCROLL |
                     ES_LEFT | ES_MULTILINE | ES_READONLY | ES_AUTOHSCROLL |
                     ES_AUTOVSCROLL
-    LTEXT           "If you experience installation problems consider trying "
-                    "official mirrors only.\n\n"
+    LTEXT           "If you experience installation problems consider trying "\
+                    "official mirrors only.\n\n"\
                     "Do you want to continue, using this/these mirror(s)?",
                     IDC_STATIC,7,88,303,24
     CONTROL         "&Don't warn me about this/these mirror(s) again",
@@ -454,34 +457,34 @@
     IDS_WINDOW_INIT_BADMSG  "Fatal Error: Unexpected windows message
%u received too early in window initialization."
     IDS_UNCAUGHT_EXCEPTION  "Fatal Error: Uncaught Exception\nThread:
%s\nType: %s\nMessage: %s"
     IDS_UNCAUGHT_EXCEPTION_WITH_ERRNO  "Fatal Error: Uncaught
Exception\nThread: %s\nType: %s\nMessage: %s\nAppErrNo: %d"
-    IDS_TRUSTKEEP_TOOLTIP   "Sets all packages to their currently installed "
-       "version.  This is equivalent to telling setup not to make any "
+    IDS_TRUSTKEEP_TOOLTIP   "Sets all packages to their currently installed "\
+       "version.  This is equivalent to telling setup not to make any "\
        "changes to any package."
-    IDS_TRUSTPREV_TOOLTIP   "Globally select the version marked as 'Prev', "
-       "which generally means the version that was last considered stable "
+    IDS_TRUSTPREV_TOOLTIP   "Globally select the version marked as 'Prev', "\
+       "which generally means the version that was last considered stable "\
        "prior to the current stable version."
-    IDS_TRUSTCURR_TOOLTIP   "Globally select the version that is currently "
+    IDS_TRUSTCURR_TOOLTIP   "Globally select the version that is currently "\
        "considered the most stable. (RECOMMENDED)"
-    IDS_TRUSTEXP_TOOLTIP    "Globally select the most recent version, even if "
+    IDS_TRUSTEXP_TOOLTIP    "Globally select the most recent version,
even if "\
        "that version is considered Experimental or for test use by
the maintainer."
-    IDS_VIEWBUTTON_TOOLTIP  "Cycles the package view.  This determines "
-       "which packages are shown in the chooser below.\r\n"
-       "\r\n"
-       "Category: Group by package category.  Click on '+' to expand.\r\n"
-       "\r\n"
-       "Full: Show all packages.\r\n"
-       "\r\n"
-       "Partial: Show only packages that are about to be installed, removed, "
-       "or upgraded.  This tells you everything that setup is about to change "
-       "when you press 'Next'.\r\n"
-       "\r\n"
-       "Up To Date: Show installed packages that need no action because they "
-       "are at the desired version already.\r\n"
-       "\r\n"
-       "Not installed: Show packages that are are not currently installed "
+    IDS_VIEWBUTTON_TOOLTIP  "Cycles the package view.  This determines "\
+       "which packages are shown in the chooser below.\r\n"\
+       "\r\n"\
+       "Category: Group by package category.  Click on '+' to expand.\r\n"\
+       "\r\n"\
+       "Full: Show all packages.\r\n"\
+       "\r\n"\
+       "Partial: Show only packages that are about to be installed, removed, "\
+       "or upgraded.  This tells you everything that setup is about
to change "\
+       "when you press 'Next'.\r\n"\
+       "\r\n"\
+       "Up To Date: Show installed packages that need no action because they "\
+       "are at the desired version already.\r\n"\
+       "\r\n"\
+       "Not installed: Show packages that are are not currently installed "\
        "and haven't been selected for installation."
-    IDS_HIDEOBS_TOOLTIP     "If selected, setup will hide packages in
categories "
-       "with names that begin with '_'.  Such packages are usually empty "
-       "placeholders for packages that have been removed or renamed, or are "
+    IDS_HIDEOBS_TOOLTIP     "If selected, setup will hide packages in
categories "\
+       "with names that begin with '_'.  Such packages are usually empty "\
+       "placeholders for packages that have been removed or renamed, or are "\
        "infrastructure packages that are handled automatically."
 END
diff -dur setup-2.573.2.2-orig/root.cc setup-2.573.2.2/root.cc
--- setup-2.573.2.2-orig/root.cc	2006-04-07 00:45:19.000000000 +0800
+++ setup-2.573.2.2/root.cc	2008-08-09 16:54:06.000000000 +0800
@@ -79,7 +79,13 @@
 {
   rbset (h, rb, root_text);
   rbset (h, su, root_scope);
+
+#ifndef __WINE__
   eset (h, IDC_ROOT_DIR, get_root_dir ());
+#else //__WINE__
+  eset (h, IDC_ROOT_DIR, wine_dos_path(get_root_dir ()));
+#endif //__WINE__
+
   check_if_enable_next (h);
 }

@@ -216,6 +222,10 @@

   save_dialog (h);

+#ifdef __WINE__ //FIXME
+  return 0;
+#endif
+
   if (!directory_is_absolute ())
     {
       note (h, IDS_ROOT_ABSOLUTE);
diff -dur setup-2.573.2.2-orig/script.cc setup-2.573.2.2/script.cc
--- setup-2.573.2.2-orig/script.cc	2007-02-28 08:55:04.000000000 +0800
+++ setup-2.573.2.2/script.cc	2008-08-09 16:54:06.000000000 +0800
@@ -33,6 +33,10 @@
 #include "script.h"
 #include "mkdir.h"

+#ifdef __WINE__
+#  include "mount.h"
+#endif
+
 static std::string sh;
 static const char *cmd = 0;

@@ -49,7 +53,11 @@
 {
   for (int i = 0; shells[i]; i++)
     {
+#ifndef __WINE__
       sh = backslash (cygpath (shells[i]));
+#else
+      sh = wine_unix_path (cygpath (shells[i]));
+#endif
       if (_access (sh.c_str(), 0) == 0)
 	break;
       sh.clear();
@@ -57,10 +65,17 @@

   char old_path[MAX_PATH];
   GetEnvironmentVariable ("PATH", old_path, sizeof (old_path));
+#ifndef __WINE__
   SetEnvironmentVariable ("PATH", backslash (cygpath ("/bin") + ";" +
 					     cygpath ("/usr/bin") + ";" +
 					     old_path).c_str());
   SetEnvironmentVariable ("CYGWINROOT", get_root_dir ().c_str());
+#else //__WINE__
+  SetEnvironmentVariable ("PATH", (backslash (cygpath ("/bin")) + ";" +
+					     backslash (cygpath ("/usr/bin")) + ";" +
+					     old_path).c_str()); //FIXME
+  SetEnvironmentVariable ("CYGWINROOT", wine_dos_path( get_root_dir
()).c_str());
+#endif //__WINE__

   if (IsWindowsNT ())
     cmd = "cmd.exe";
@@ -209,7 +224,12 @@
      postinstall script by the same name.  When we are called the second
      time the file has already been renamed to .done, and if we don't
      return here we end up erroniously deleting this .done file.  */
+#ifndef __WINE__
   std::string windowsName = backslash (cygpath (scriptName));
+#else
+  std::string windowsName = wine_unix_path (cygpath (scriptName));
+#endif
+
   if (_access (windowsName.c_str(), 0) == -1)
     {
       log(LOG_PLAIN) << "can't run " << scriptName << ": No such file"
@@ -220,6 +240,8 @@
   int retval;
   char tmp_pat[] = "/var/log/setup.log.postinstallXXXXXXX";
   OutputLog file_out = std::string (mktemp (tmp_pat));
+
+#ifndef __WINE__
   if (sh.size() && stricmp (extension(), ".sh") == 0)
     {
       log(LOG_PLAIN) << "running: " << sh << " -c " << scriptName << endLog;
@@ -232,6 +254,20 @@
     }
   else
     return -ERROR_INVALID_DATA;
+#else //__WINE__
+  if (sh.size() && strcasecmp (extension(), ".sh") == 0)
+    {
+      log(LOG_PLAIN) << "running: " << sh << " -c " << scriptName << endLog;
+      retval = ::run (sh.c_str(), "-c", scriptName.c_str(), file_out);
+    }
+  else if (cmd && strcasecmp (extension(), ".bat") == 0)
+    {
+      log(LOG_PLAIN) << "running: " << cmd << " /c " << windowsName << endLog;
+      retval = ::run (cmd, "/c", windowsName.c_str(), file_out);
+    }
+  else
+    return -ERROR_INVALID_DATA;
+#endif //__WINE__

   if (!file_out.isEmpty ())
     log(LOG_BABBLE) << file_out << endLog;
diff -dur setup-2.573.2.2-orig/site.cc setup-2.573.2.2/site.cc
--- setup-2.573.2.2-orig/site.cc	2006-04-16 05:21:25.000000000 +0800
+++ setup-2.573.2.2/site.cc	2008-08-09 17:20:07.000000000 +0800
@@ -28,7 +28,9 @@
 #include "win32.h"
 #include <stdio.h>
 #include <stdlib.h>
-#include <process.h>
+#ifndef __WINE__
+#  include <process.h>
+#endif

 #include "dialog.h"
 #include "resource.h"
@@ -189,13 +191,21 @@
 bool
 site_list_type::operator == (site_list_type const &rhs) const
 {
+#ifndef __WINE__
   return stricmp (key.c_str(), rhs.key.c_str()) == 0;
+#else
+  return strcasecmp (key.c_str(), rhs.key.c_str()) == 0;
+#endif
 }

 bool
 site_list_type::operator < (site_list_type const &rhs) const
 {
+#ifndef __WINE__
   return stricmp (key.c_str(), rhs.key.c_str()) < 0;
+#else
+  return strcasecmp (key.c_str(), rhs.key.c_str()) < 0;
+#endif
 }

 static void
@@ -294,7 +304,7 @@
     if (f)
       {
 	int len;
-	while (len = f->read (mirror_url, 999))
+	while ((len = f->read (mirror_url, 999)))
 	  {
 	    mirror_url[len] = '\0';
 	    cached_mirrors += mirror_url;
@@ -359,10 +369,17 @@
     {
       /* Don't default to certain machines ever since they suffer
 	 from bandwidth limitations. */
+    #ifndef __WINE__
       if (strnicmp (site, NOSAVE1, NOSAVE1_LEN) == 0
 	  || strnicmp (site, NOSAVE2, NOSAVE2_LEN) == 0
 	  || strnicmp (site, NOSAVE3, NOSAVE3_LEN) == 0)
 	return;
+    #else //__WINE__
+      if (strncasecmp (site, NOSAVE1, NOSAVE1_LEN) == 0
+	  || strncasecmp (site, NOSAVE2, NOSAVE2_LEN) == 0
+	  || strncasecmp (site, NOSAVE3, NOSAVE3_LEN) == 0)
+	return;
+    #endif //__WINE__
       SiteList result;
       merge (all_site_list.begin(), all_site_list.end(),
 	     &tempSite, &tempSite + 1,
@@ -450,7 +467,7 @@
   CreateThread (NULL, 0, do_download_site_info_thread, context, 0, &threadID);
 }

-static BOOL CALLBACK
+static INT_PTR CALLBACK
 drop_proc (HWND h, UINT message, WPARAM wParam, LPARAM lParam)
 {
   switch (message)
diff -dur setup-2.573.2.2-orig/String++.cc setup-2.573.2.2/String++.cc
--- setup-2.573.2.2-orig/String++.cc	2006-04-18 01:01:52.000000000 +0800
+++ setup-2.573.2.2/String++.cc	2008-08-09 17:20:58.000000000 +0800
@@ -11,6 +11,7 @@
  */

 #include "String++.h"
+#include <string.h>
 #include <sstream>
 #include <algorithm>

diff -dur setup-2.573.2.2-orig/UserSetting.cc setup-2.573.2.2/UserSetting.cc
--- setup-2.573.2.2-orig/UserSetting.cc	2004-10-26 01:06:07.000000000 +0800
+++ setup-2.573.2.2/UserSetting.cc	2008-08-09 16:54:05.000000000 +0800
@@ -23,7 +23,9 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <process.h>
+#ifndef __WINE__
+#  include <process.h>
+#endif
 #include <algorithm>

 #include "LogSingleton.h"
diff -dur setup-2.573.2.2-orig/UserSettings.cc setup-2.573.2.2/UserSettings.cc
--- setup-2.573.2.2-orig/UserSettings.cc	2006-04-16 05:21:25.000000000 +0800
+++ setup-2.573.2.2/UserSettings.cc	2008-08-09 16:54:05.000000000 +0800
@@ -23,7 +23,9 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <process.h>
+#ifndef __WINE__
+#  include <process.h>
+#endif
 #include <algorithm>

 #include "LogSingleton.h"
diff -dur setup-2.573.2.2-orig/win32.cc setup-2.573.2.2/win32.cc
--- setup-2.573.2.2-orig/win32.cc	2007-02-28 08:55:04.000000000 +0800
+++ setup-2.573.2.2/win32.cc	2008-08-09 17:21:37.000000000 +0800
@@ -19,6 +19,7 @@
 #endif

 #include "win32.h"
+#include <memory>
 #include "LogFile.h"


========================
After patch, run:
CC="winegcc" \
CXX="wineg++" \
LIBS="-lcrtdll -lwininet" \
WINDRES=wrc \
./configure --prefix=/somewhere --enable-shared=no &&
make &&
wine setup.exe.so

Sorry for my english!

Eric Zhao

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]