ok, my idea is to poke gpg/winpt a little so that it doesn't use the registry or any fixed directories (like C:\Documents and Settings\User\ or whatever) so i'd like to be able to run it under a debugger.. this is what i did to compile gpg/gpgme/winpt from source under windows (mingw/msys, <a href="http://clbianco.altervista.org/gnupg/eng/gnupg.html">http://clbianco.altervista.org/gnupg/eng/gnupg.html</a> explains how to install that environment), i have no idea if any of this breaks anything (esp the gpgme implementation as there is some tweaking to do) but at least the fscking thing compiles.. and if i get a poked version working properly i can always compile the "dist" version on a *nix..<br>
<br>compiled gpg-1.4.9 as per <a href="http://clbianco.altervista.org/gnupg/eng/gnupg.html">http://clbianco.altervista.org/gnupg/eng/gnupg.html</a> it's essentially these steps:<br>1. change a test script (seat.test) to handle \r\n:<br>
$ sed -i -e "s/cmp \$i/unix2dos -c 7bit -n \$i z\n cmp z/" gpg-1.4.9/checks/seat.test<br>2. run configure with a few flags to make it as machine independent as possible (i just stole them from clbianco)<br>
$ ./configure CFLAGS="-O3 -mtune=i386 -march=i386 -mfpmath=387 -mno-mmx -mno-sse -mno-3dnow -mno-sse2" LDFLAGS=-s<br>3. $ make<br><br>compiled libgpg-error-1.6 out of the box by<br>$ ./configure<br>$ make install<br>
<br>to compile gpgme-1.1.4 i:<br>1. modified assuan.h (after the stand alone version of libassuan)<br> $ diff -B assuan_orig/assuan.h assuan/assuan.h<br> 462a463<br> > #ifndef _WIN32<br> 464a466<br> > #endif<br>
<br>2. modified assuan-connect.c (after the stand alone version of libassuan)<br> $ diff -B assuan_orig/assuan-connect.c assuan/assuan-connect.c<br> 61a62<br> > #ifndef HAVE_W32_SYSTEM<br> 71a73<br> > #ifdef HAVE_SO_PEERCRED<br>
77a80<br> > #endif<br> 79a83<br> > #endif /* HAVE_W32_SYSTEM */<br><br>3. modified assuan-defs.h (after stand alone version of libassuan)<br> $ diff -B assuan_orig/assuan-defs.h assuan/assuan-defs.h<br>
144a145<br> > #ifdef HAVE_SO_PEERCRED<br> 147a149<br> > #endif /* HAVE_SO_PEERCRED */<br> 282a285,288<br> > #ifdef HAVE_W32_SYSTEM<br> > int _assuan_simple_sendmsg (assuan_context_t ctx, void *msg);<br>
> int _assuan_simple_recvmsg (assuan_context_t ctx, void *msg);<br> > #else<br> 284a291<br> > #endif<br><br>4. modified assuan-socket-server.c (after the stand alone version of libassuan)<br> $ diff -B assuan_orig/assuan-socket-server.c assuan/assuan-socket-server.c<br>
82c82<br> < <br> ---<br> > #define socklen_t int<br><br>5. conditionally (#ifndef _WIN32) removed the contents of funopen.c (after the stand alone version of libassaun which doesn't even compile funopen.c)<br>
$ diff -B assuan_orig/funopen.c assuan/funopen.c<br> 21a22<br> > #ifndef _WIN32<br> 64a66<br> > #endif /* _WIN32 */<br><br>6. modified assuan-io.c (after the stand alone version of libassuan)<br> $ diff -B assuan_orig/assuan-io.c assuan/assuan-io.c<br>
28c28,30<br> < #include <sys/socket.h><br> ---<br> > #ifdef HAVE_SYS_SOCKET_H<br> > # include <sys/socket.h><br> > #endif<br> 61a64,67<br> > #ifdef HAVE_W32_SYSTEM<br> > int<br>
> _assuan_simple_sendmsg (assuan_context_t ctx, void *msg)<br> > #else<br> 63a70<br> > #endif<br> 75c82,85<br> < <br> ---<br> > #ifdef HAVE_W32_SYSTEM<br> > int<br> > _assuan_simple_recvmsg (assuan_context_t ctx, void *msg)<br>
> #else<br> 77a88<br> > #endif<br><br>7. modified setenv.c, changed "#if HAVE_ASSUAN_H" to "#ifdef HAVE_ASSUAN_H" as HAVE_ASSUAN_H is just defined, but not to a value<br> $ diff -B gpgme_orig/setenv.c gpgme/setenv.c<br>
23c23<br> < #if HAVE_ASSUAN_H<br> ---<br> > #ifdef HAVE_ASSUAN_H<br><br>8. modified tests/gpg/t-eventloop.c for a conditional include of sys/select.h or sys/time.h and added a conditional include of winsock2.h<br>
$ diff -B tests/gpg_orig/t-eventloop.c tests/gpg/t-eventloop.c<br> 34c34,41<br> < #include <sys/select.h><br> ---<br> > # ifdef HAVE_SYS_SELECT_H<br> > # include <sys/select.h><br>
> # else<br> > # include <sys/time.h><br> > # endif<br> > #ifdef _WIN32<br> > #include <winsock2.h><br> > #endif<br><br>9. modified tests/gpg/t-wait.c to conditionally (#ifdef _WIN32) include windows.h and use Sleep() instead of sleep()<br>
$ diff -B tests/gpg_orig/t-wait.c tests/gpg/t-wait.c<br> 31a32,35<br> > #ifdef _WIN32<br> > #include <windows.h><br> > #endif<br> > <br> 57a62<br> > #ifndef _WIN32<br> 59c64,66<br>
< <br> ---<br> > #else<br> > Sleep(1);<br> > #endif<br><br>10. ran configure adding wsock32 for linking<br> $ ./configure LDFLAGS=-lwsock32<br><br>11. modified config.h by "#undef ENABLE_GPGSM" and "#undef GPGSM_PATH" to remove gpgsm support and "#undef USE_DESCRIPTOR_PASSING" after the stand alone version of libassuan, there's probably some nifty way to do this with configure however i'm not too suave with configure-automake-autoconf-autowhatever-weird-sh-scripts so i cheated :)<br>
<br>12. modified the tests/gpg/Makefile to exclude the thread test (it could probably be enabled by adding pthreads-w32), removed the t-thread1$(EXEEXT) from am__EXEEXT_1<br><br>13. $ make install<br><br>well obviously that's not the order i did it in :) rather "make - correct an error - make - correct an error"..<br>
<br>and then for winpt-1.2.0<br>$ ./configure<br>$ cd Gnupg ; make<br>$ cd ../PTD ; make<br>$ cd ../Src ; make<br>and voila: you have one WinPT.exe a deguster ;)<br><br>and now i just have to poke it a little, i'll post the diffs for that if anyone's interested..<br>
<br>j<br>