[CMake] cmake for cygwin at 64bit

marco atzeri marco.atzeri at gmail.com
Fri Mar 15 12:14:34 EDT 2013


On 3/15/2013 4:41 PM, Bill Hoffman wrote:
> On 3/15/2013 11:31 AM, marco atzeri wrote:
>> ok, found.
>> I do not need to malloc the space for the win32_path
>> assigning again the pointer does not work.
>>
>> Next step, to check if no other issues on 64bit
> Yes, that would do it...   If you allocate new memory then the
> information never gets passed back to the caller... :)
>
> -Bill
>

copy and past code, sometimes, does not work.
attached the patch to remove cygwin_conv_to_win32_path.

First bootstrap on cygwin64 works,
still running the rest of the build.

Marco


-------------- next part --------------
--- ../orig/cmake-2.8.9/Source/kwsys/SystemTools.cxx	2012-08-15 21:28:03.000000000 +0200
+++ cmake-2.8.9/Source/kwsys/SystemTools.cxx	2013-03-15 16:56:12.540496600 +0100
@@ -85,7 +85,21 @@
 #endif
 
 #ifdef __CYGWIN__
-extern "C" void cygwin_conv_to_win32_path(const char *path, char *win32_path);
+typedef unsigned int cygwin_conv_path_t;
+enum
+{
+  CCP_POSIX_TO_WIN_A = 0, /* from is char*, to is char*       */
+  CCP_POSIX_TO_WIN_W,     /* from is char*, to is wchar_t*    */
+  CCP_WIN_A_TO_POSIX,     /* from is char*, to is char*       */
+  CCP_WIN_W_TO_POSIX,     /* from is wchar_t*, to is char*    */
+
+  CCP_CONVTYPE_MASK = 3,
+
+  /* Or these values to the above as needed. */
+  CCP_ABSOLUTE = 0,       /* Request absolute path (default). */
+  CCP_RELATIVE = 0x100    /* Request to keep path relative.   */
+};
+extern "C" ssize_t cygwin_conv_path( cygwin_conv_path_t what, const void * from, void * to, size_t size );	 
 #endif
 
 // getpwnam doesn't exist on Windows and Cray Xt3/Catamount
@@ -1123,7 +1137,15 @@
     }
   else
     {
-    cygwin_conv_to_win32_path(path, win32_path);
+    ssize_t size;
+    size=cygwin_conv_path(CCP_POSIX_TO_WIN_A, path, NULL, 0 );
+    if (size < 0)
+      perror ("cygwin_conv_path");
+    else
+      {
+        if (cygwin_conv_path(CCP_POSIX_TO_WIN_A, path, win32_path, size ))
+             perror ("cygwin_conv_path");
+      }
     SystemToolsTranslationMap::value_type entry(path, win32_path);
     SystemTools::Cyg2Win32Map->insert(entry);
     }


More information about the CMake mailing list