[imapfilter-devel] Patch for cygwin
Gautam Gopalakrishnan
gautam.gopalakrishnan at its.monash.edu.au
Thu Apr 29 03:20:49 EEST 2004
Hello,
I'm attaching a patch so that imapfilter builds on cygwin (quite a recent
release). Had to patch imapfilter.h and the config script.
Please let me know what you think.
Cheers
Gautam
-------------- next part --------------
diff -rc imapfilter-0.9.6/config imapfilter-0.9.6-new/config
*** imapfilter-0.9.6/config Mon Feb 9 08:45:11 2004
--- imapfilter-0.9.6-new/config Wed Apr 28 11:39:34 2004
***************
*** 166,171 ****
--- 166,177 ----
cflags="-O"
fi
+ # Cygwin needs:
+ # - BIN to have .exe extension
+ # - LIBS to be after OBJ
+
+ uname -a | grep -qi cygwin
+ CYGWIN=$?
# Backup of original Makefile and config.h
***************
*** 189,205 ****
MAN_BIN = imapfilter.1
MAN_RC = imapfilterrc.5
! BIN = imapfilter
OBJ = account.o action.o auth.o buffer.o cert.o destroy.o file.o filter.o \\
imap.o imapfilter.o lock.o log.o match.o memory.o misc.o parse.o \\
passwd.o response.o request.o socket.o tty.o
LIBS = $libs
! all: imapfilter
! imapfilter: \$(OBJ)
! \$(CC) \$(LIBS) \$(LDFLAGS) -o \$(BIN) \$(OBJ)
account.o action.o auth.o buffer.o cert.o destroy.o file.o filter.o imap.o \\
imapfilter.o lock.o log.o match.o memory.o parse.o passwd.o \\
--- 195,227 ----
MAN_BIN = imapfilter.1
MAN_RC = imapfilterrc.5
! EOF
!
! if [ $CYGWIN = 0 ]; then
! echo "BIN = imapfilter.exe" >> Makefile
! else
! echo "BIN = imapfilter" >> Makefile
! fi
!
! cat >> Makefile <<EOF
OBJ = account.o action.o auth.o buffer.o cert.o destroy.o file.o filter.o \\
imap.o imapfilter.o lock.o log.o match.o memory.o misc.o parse.o \\
passwd.o response.o request.o socket.o tty.o
LIBS = $libs
! all: \$(BIN)
!
! \$(BIN): \$(OBJ)
! EOF
!
! if [ $CYGWIN = 0 ]; then
! echo " \$(CC) \$(LDFLAGS) -o \$(BIN) \$(OBJ) \$(LIBS)" >> Makefile
! else
! echo " \$(CC) \$(LIBS) \$(LDFLAGS) -o \$(BIN) \$(OBJ)" >> Makefile
! fi
! cat >> Makefile <<EOF
account.o action.o auth.o buffer.o cert.o destroy.o file.o filter.o imap.o \\
imapfilter.o lock.o log.o match.o memory.o parse.o passwd.o \\
diff -rc imapfilter-0.9.6/imapfilter.h imapfilter-0.9.6-new/imapfilter.h
*** imapfilter-0.9.6/imapfilter.h Mon Feb 9 08:45:01 2004
--- imapfilter-0.9.6-new/imapfilter.h Wed Apr 28 11:39:34 2004
***************
*** 14,19 ****
--- 14,28 ----
#endif
+ /*
+ Cygwin blotch
+ 2048 is the value in limits.h in cygwin
+ */
+ #ifndef LINE_MAX
+ #define LINE_MAX 2048
+ #endif
+
+
/* Error codes returned by functions. */
#define ERROR_SIGNAL 1
#define ERROR_TRIVIAL 2
More information about the Imapfilter-devel
mailing list