[mew-win32 03385] Re: GnuPG 1.0.6 on Mew 2.0

K. Umakoshi unisus at example.com
2001年 8月 12日 (日) 22:26:17 JST


 From: KAMEI Ken-ichi <mule at example.com>
 Subject: [mew-win32 03384] Re: GnuPG 1.0.6 on Mew 2.0
 Date: Thu, 09 Aug 2001 19:19:00 +0900 (LMT)
 Message-Id: <20010809.191900.60851151.mule at example.com>
/~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> いや、1.0.6 もちょっと手をつけたのですが、どうも 1.0.6 の
> configure が変更されたらしく、私の環境ではまともに動作してくれな
> くて滞ったまま放っています。
> # cygwin がいけないのか、gnupg がいけないのかわからなかったものですか
> # ら...。autoconf とかのお勉強までは手が回りませんでした。

    % uname -a
    CYGWIN_NT-5.0 UNICORN 1.3.2(0.39/3/2) 2001-05-20 23:28 i686 unknown

上で cygwin 版を作ると、trustdb.gpg の読み込みに失敗したりと
まともに動きませんでした。

そこで、

    % uname -srm
    FreeBSD 4.3-RELEASE i386

上の Mingw で作ってみると、
Mew から sign, decrypt も動くようになりました。
(オリジナル版で動いていた encrypt, verify sign もOK)


> mingw32 のオプション指定をして怒られたような記憶があるので、
> cygwin として configure を掛けてから patch を当てれば作れるかも
> しれません。
> 
> patch は mingw32 を gcc -mno-cygwin にするための patch を含んで
> いますが、configure が変更されたらしく 1.0.6 ではこの部分は
> reject されると思います。
> 
> できれば .c .h 関係の patch 部分を手で当てるほうが良いと思います。

rndw32.c, ttyio.c だけを手で当てました。
そして、
(1) ./configure --target=i386--mingw32 --disable-asm
(2) config.h を修正。
    USE_ONLY_8DOT3 を undef
(3) gmake
としました。
# 途中なぜか ar でこけたけど、手動で ar して何とか gmake 完了。

ごく簡単な動作テストしかしてませんが、
一応パッチを添付しておきます。
バイナリーを欲しい方がいれば、どこかに置きますので連絡ください。


----
馬越
-------------- next part --------------
diff -c gnupg-1.0.6/cipher/rndw32.c.orig gnupg-1.0.6/cipher/rndw32.c
*** gnupg-1.0.6/cipher/rndw32.c.orig	Sun Apr 29 03:52:40 2001
--- gnupg-1.0.6/cipher/rndw32.c	Sun Aug 12 19:51:06 2001
***************
*** 67,72 ****
--- 67,73 ----
  #include <string.h>
  
  #include <windows.h>
+ #include <winioctl.h>
  
  
  #include "types.h"
diff -c gnupg-1.0.6/util/ttyio.c.orig gnupg-1.0.6/util/ttyio.c >> gnupg-1.0.6-mew.diff
*** gnupg-1.0.6/util/ttyio.c.orig	Fri May 25 15:45:34 2001
--- gnupg-1.0.6/util/ttyio.c	Sun Aug 12 20:49:42 2001
***************
*** 98,104 ****
  	return;
  
    #if defined(__MINGW32__)
!     {
  	SECURITY_ATTRIBUTES sa;
  
  	memset(&sa, 0, sizeof(sa));
--- 98,104 ----
  	return;
  
    #if defined(__MINGW32__)
!     if(isatty(fileno(stdin))) {
  	SECURITY_ATTRIBUTES sa;
  
  	memset(&sa, 0, sizeof(sa));
***************
*** 117,122 ****
--- 117,125 ----
  			       &sa, OPEN_EXISTING, 0, 0 );
  	if( con.in == INVALID_HANDLE_VALUE )
  	    log_fatal("open(CONIN$) failed: rc=%d", (int)GetLastError() );
+     }else{
+ 	con.out = GetStdHandle(STD_OUTPUT_HANDLE);
+ 	con.in	= GetStdHandle(STD_INPUT_HANDLE);
      }
      SetConsoleMode(con.in, DEF_INPMODE );
      SetConsoleMode(con.out, DEF_OUTMODE );
***************
*** 194,200 ****
  	    log_bug("vsprintf() failed\n");
        #endif
  
! 	if( !WriteConsoleA( con.out, buf, n, &nwritten, NULL ) )
  	    log_fatal("WriteConsole failed: rc=%d", (int)GetLastError() );
  	if( n != nwritten )
  	    log_fatal("WriteConsole failed: %d != %d\n", n, nwritten );
--- 197,203 ----
  	    log_bug("vsprintf() failed\n");
        #endif
  
! 	if( !WriteFile( con.out, buf, n, &nwritten, NULL ) )
  	    log_fatal("WriteConsole failed: rc=%d", (int)GetLastError() );
  	if( n != nwritten )
  	    log_fatal("WriteConsole failed: %d != %d\n", n, nwritten );
***************
*** 319,325 ****
      for(;;) {
  	DWORD nread;
  
! 	if( !ReadConsoleA( con.in, cbuf, 1, &nread, NULL ) )
  	    log_fatal("ReadConsole failed: rc=%d", (int)GetLastError() );
  	if( !nread )
  	    continue;
--- 322,328 ----
      for(;;) {
  	DWORD nread;
  
! 	if( !ReadFile( con.in, cbuf, 1, &nread, NULL ) )
  	    log_fatal("ReadConsole failed: rc=%d", (int)GetLastError() );
  	if( !nread )
  	    continue;
***************
*** 428,434 ****
      if( !last_prompt_len )
  	return;
    #ifdef __MINGW32__
!     tty_printf("\r%*s\r", last_prompt_len, "");
    #else
      {
  	int i;
--- 431,438 ----
      if( !last_prompt_len )
  	return;
    #ifdef __MINGW32__
!     if(isatty(fileno(stdin)))
! 	tty_printf("\r%*s\r", last_prompt_len, "");
    #else
      {
  	int i;


Mew-win32 メーリングリストの案内