Subject: Compiling under cygwin and fixing x-permission handling
From: Frank-Michael Moser <[email-masked]>
To: [email-masked]
Date: Thu, 03 May 2001 11:46:42 +0200

Hi,

I am not really experienced in programming C,
but somtimes when I have to compile something
under cygwin I try to fix some compilation errors.
Mostly this ends up in simply commenting out the 
special lines.

But a special compilation problem under cygwin 
seems to be the querying of x-file-permissions.

Compiling the midnight commander e.g. I had to change 
the following lines.

$ cat mc-4.5.54/.cygwin.diff.src#chmod.c
--- .cygwin.org.src#chmod.c     Tue May  1 11:52:36 2001
+++ src/chmod.c Sun Apr 29 21:11:32 2001
@@ -92,13 +92,17 @@
     WCheck *check;
 } check_perm[PERMISSIONS] =
 {
-    { S_IXOTH, N_("execute/search by others"), 0, 0, },
+    // some patches for cygwin
+    //{ S_IXOTH, N_("execute/search by others"), 0, 0, },
+    { S_IWOTH, N_("execute/search by others"), 0, 0, },
     { S_IWOTH, N_("write by others"), 0, 0, },
     { S_IROTH, N_("read by others"), 0, 0, },
-    { S_IXGRP, N_("execute/search by group"), 0, 0, },
+    //{ S_IXGRP, N_("execute/search by group"), 0, 0, },
+    { S_IWGRP, N_("execute/search by group"), 0, 0, },
     { S_IWGRP, N_("write by group"), 0, 0, },
     { S_IRGRP, N_("read by group"), 0, 0, },
-    { S_IXUSR, N_("execute/search by owner"), 0, 0, },
+    //{ S_IXUSR, N_("execute/search by owner"), 0, 0, },
+    { S_IWUSR, N_("execute/search by owner"), 0, 0, },
     { S_IWUSR, N_("write by owner"), 0, 0, },
     { S_IRUSR, N_("read by owner"), 0, 0, },
     { S_ISVTX, N_("sticky bit"), 0, 0, },

Compiling lyx I had to fix:

$ cat lyx-1.1.6fix1/.cygwin.diff.src#support#FileInfo.h
--- lyx-1.1.6fix1/.cygwin.org.src#support#FileInfo.h    Tue May  1
11:15:10 2001
+++ lyx-1.1.6fix1/src/support/FileInfo.h        Tue May  1 11:15:10 2001
@@ -96,7 +96,7 @@
                /// test for write permission
                wperm = W_OK,
                /// test for execute (search) permission
-               xperm = X_OK,
+               //xperm = X_OK,
                /// test for existence of file
                eperm = F_OK
        };
@@ -107,7 +107,7 @@
        /// Is the file readable for the current user?
        bool readable() const { return access(FileInfo::rperm); }
        /// Is the file executable for the current user?
-       bool executable() const { return access(FileInfo::xperm); }
+       bool executable() const { return access(FileInfo::wperm); }
        /// Does the file exist?
        bool exist() const { return access(FileInfo::eperm); }
        ///

These are really terrible fixes, so my question is, 
can I hinder the compiler to give errors at thise lines 
by customizing my environment? Or is there a better fix than 
commenting out the lines or replacing x with w permissions?

Frank-Michael.

--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple