patrickpeng2091 / lsyncd

Automatically exported from code.google.com/p/lsyncd
GNU General Public License v2.0
0 stars 0 forks source link

Doesn't compile properly under Interix #53

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I'm interested in compiling lsyncd to run under Interix, specifically the 
version of SFU which comes with Windows 7. I got LUA and rsync to compile and 
install OK, but lsyncd is giving me some trouble.

A log of my build error is below. Any chance I could get a patch?

<Epsilon>~/lsyncd-2.0.4$ make

make  all-am
gcc -DHAVE_CONFIG_H -I.    -D_ALL_SOURCE -I/usr/local/include  
-I/usr/local/ssl/include -I/usr/local/include/php  -D_ALL
_SOURCE -Wall -I/usr/local/include -MT lsyncd.o -MD -MP -MF .deps/lsyncd.Tpo -c 
-o lsyncd.o lsyncd.c
lsyncd.c:1006:9: warning: #warning must use oldstyle realpath()
lsyncd.c: In function `l_readdir':
lsyncd.c:1113: error: structure has no member named `d_type'
lsyncd.c:1113: error: `DT_UNKNOWN' undeclared (first use in this function)
lsyncd.c:1113: error: (Each undeclared identifier is reported only once
lsyncd.c:1113: error: for each function it appears in.)
lsyncd.c:1125: error: structure has no member named `d_type'
lsyncd.c:1125: error: `DT_DIR' undeclared (first use in this function)
lsyncd.c: In function `masterloop':
lsyncd.c:1611: error: `fd_set' undeclared (first use in this function)
lsyncd.c:1611: error: parse error before "rfds"
lsyncd.c:1617: warning: implicit declaration of function `FD_ZERO'
lsyncd.c:1617: error: `rfds' undeclared (first use in this function)
lsyncd.c:1618: error: `wfds' undeclared (first use in this function)
lsyncd.c:1623: warning: implicit declaration of function `FD_SET'
lsyncd.c:1636: warning: implicit declaration of function `pselect'
lsyncd.c:1648: warning: implicit declaration of function `FD_ISSET'
*** Error code 1

Original issue reported on code.google.com by nicholas...@gmail.com on 29 Mar 2011 at 8:12

GoogleCodeExporter commented 9 years ago
The environment you try to compile it under seems to have problems with some 
Posix structures, how does "struct dirent" look like?

Anyway, I doubt you will have an inotify interface on Interix with a 
Windowskernel. This rules out running Lsyncd on it :-(

Original comment by axk...@gmail.com on 29 Mar 2011 at 8:42

GoogleCodeExporter commented 9 years ago
Nuts. You're right. :(

I got lsyncd.c to compile by removing the if() statement at line 1113 and 
forcing the DT_UNKNOWN branch which uses lstat() and S_ISDIR() instead of 
(de->d_type == DT_DIR). I also had to add <sys/select.h> to the header 
#includes. 

But then once I got past lsyncd.c, inotify.c started throwing errors and I came 
to the same conclusion you did - that Interix doesn't offer that functionality. 
:(

Original comment by nicholas...@gmail.com on 29 Mar 2011 at 4:16

GoogleCodeExporter commented 9 years ago
Windows has its own event queues. Lsyncd would need its own adapter for that 
like it has already for Linux' inotify and OSX' fsevents. However, this isn't 
on my TODO list in any near future. 

At least I'll add <sys/select.h> to lsyncd.c, seems i forgot that.

Original comment by axk...@gmail.com on 30 Mar 2011 at 10:14