public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* gpg-agent: only one trouble before succesfull building
       [not found] <1149964625.8941.ezmlm@cygwin.com>
@ 2006-06-10 20:13 ` gabriele.mailing
  2006-06-11  0:30   ` René Berber
  0 siblings, 1 reply; 3+ messages in thread
From: gabriele.mailing @ 2006-06-10 20:13 UTC (permalink / raw)
  To: cygwin

Hello,
This is a detailed story about the try to build gpg-agent under cygwin
I whish to use gpg-agent under cygwin, that is contained in the 
gnupg-1.9 tree only.

Here is what I have done:

#Install prerequisites

## libpth-1.4.4
cd /usr/src/
wget ftp://ftp.gnu.org/gnu/pth/pth-1.4.1.tar.gz
tar xvzf pth-1.4.1.tar.gz
cd pth-1.4.1
./configure
make
make test
make install

#libassuan
cd /usr/src/
wget ftp://ftp.gnupg.org/gcrypt/alpha/libassuan/libassuan-0.6.10.tar.gz
tar xvzf libassuan-0.6.10.tar.gz
cd
./configure
make
make install

#Installed this from official archives with setup.exe
# this is needed by libksba
# gettext

#libksba
cd /usr/src/
wget ftp://ftp.gnupg.org/gcrypt/alpha/libksba/libksba-0.9.14.tar.bz2
tar xvjf libksba-0.9.14.tar.bz2
cd libksba-0.9.14
./configure
make
make install

#Installed this from official archives with setup.exe
#libgpg-error
#libgcrypt

## Now the big ball
cd /usr/src
wget ftp://ftp.gnupg.org/gcrypt/alpha/gnupg/gnupg-1.9.20.tar.bz2
tar xvjf gnupg-1.9.20.tar.bz2
cd gnupg-1.9.20
./configure --enable-agent-only
make

And now the funny part:
...
gcc   -I/usr/local/include -g -O2 -Wall   -o gpg-connect-agent.exe  
gpg-connect-agent.o no-libgcrypt.o ../jnlib/libjnlib.a 
../common/libcommon.a ../gl/libgnu.a -L/usr/local/lib -lassuan 
-lgpg-error -lintl -lz
/usr/local/lib/libassuan.a(assuan-io.o): In function `_assuan_simple_read':
/usr/src/libassuan-0.6.10/src/assuan-io.c:44: undefined reference to 
`_pth_read'
/usr/local/lib/libassuan.a(assuan-io.o): In function `_assuan_simple_write':
/usr/src/libassuan-0.6.10/src/assuan-io.c:55: undefined reference to 
`_pth_write'
collect2: ld returned 1 exit status
make[2]: *** [gpg-connect-agent.exe] Error 1
make[2]: Leaving directory `/usr/src/gnupg-1.9.20/tools'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/usr/src/gnupg-1.9.20'
make: *** [all] Error 2

Ok, we lack "pthread support" ?
I investigated and found out that the make of libassuan said:
...
assuan-io.c:32: warning: weak declaration of 'pth_read' not supported
assuan-io.c:33: warning: weak declaration of 'pth_write' not supported
...

Mmmmh seems we need to add support when configuring....
I read the docs of pth-1.4.1 and found the configure switch for this, but:

./configure --enable-pthread
...
make
...
./libtool --mode=compile --quiet gcc -c -I. -O2 -pipe pthread.c
In file included from pthread.c:42:
pthread.h:184: warning: useless keyword or type name in empty declaration
pthread.h:184: warning: empty declaration
pthread.h:347: error: conflicting types for 'pthread_kill'
/usr/include/sys/signal.h:163: error: previous declaration of 
'pthread_kill' was here
pthread.h:347: error: conflicting types for 'pthread_kill'
/usr/include/sys/signal.h:163: error: previous declaration of 
'pthread_kill' was here
make: *** [pthread.lo] Error 1

I cant' go out of this....

Please help !

-- 
Diesis

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: gpg-agent: only one trouble before succesfull building
  2006-06-10 20:13 ` gpg-agent: only one trouble before succesfull building gabriele.mailing
@ 2006-06-11  0:30   ` René Berber
  2006-06-11 19:34     ` gabriele.mailing
  0 siblings, 1 reply; 3+ messages in thread
From: René Berber @ 2006-06-11  0:30 UTC (permalink / raw)
  To: cygwin

gabriele wrote:

> This is a detailed story about the try to build gpg-agent under cygwin
> I whish to use gpg-agent under cygwin, that is contained in the
> gnupg-1.9 tree only.
> 
> Here is what I have done:
> 
> #Install prerequisites
> 
> ## libpth-1.4.4
> cd /usr/src/
> wget ftp://ftp.gnu.org/gnu/pth/pth-1.4.1.tar.gz
> tar xvzf pth-1.4.1.tar.gz
> cd pth-1.4.1
> ./configure
> make
> make test

It's "make check".

> make install

Why use that old version? pth-2.0.6 is what I used.

> #libassuan
> cd /usr/src/
> wget ftp://ftp.gnupg.org/gcrypt/alpha/libassuan/libassuan-0.6.10.tar.gz
> tar xvzf libassuan-0.6.10.tar.gz
> cd
> ./configure
> make

Should also do "make check" just to be sure.

> make install
> 
> #Installed this from official archives with setup.exe
> # this is needed by libksba
> # gettext
> 
> #libksba
> cd /usr/src/
> wget ftp://ftp.gnupg.org/gcrypt/alpha/libksba/libksba-0.9.14.tar.bz2
> tar xvjf libksba-0.9.14.tar.bz2
> cd libksba-0.9.14
> ./configure
> make

Same here, "make check".

> make install
> 
> #Installed this from official archives with setup.exe
> #libgpg-error
> #libgcrypt
> 
> ## Now the big ball
> cd /usr/src
> wget ftp://ftp.gnupg.org/gcrypt/alpha/gnupg/gnupg-1.9.20.tar.bz2
> tar xvjf gnupg-1.9.20.tar.bz2
> cd gnupg-1.9.20
> ./configure --enable-agent-only
> make
> 
> And now the funny part:
> ...
> gcc   -I/usr/local/include -g -O2 -Wall   -o gpg-connect-agent.exe 
> gpg-connect-agent.o no-libgcrypt.o ../jnlib/libjnlib.a
> ../common/libcommon.a ../gl/libgnu.a -L/usr/local/lib -lassuan
> -lgpg-error -lintl -lz
> /usr/local/lib/libassuan.a(assuan-io.o): In function `_assuan_simple_read':
> /usr/src/libassuan-0.6.10/src/assuan-io.c:44: undefined reference to
> `_pth_read'
> /usr/local/lib/libassuan.a(assuan-io.o): In function
> `_assuan_simple_write':
> /usr/src/libassuan-0.6.10/src/assuan-io.c:55: undefined reference to
> `_pth_write'
> collect2: ld returned 1 exit status
> make[2]: *** [gpg-connect-agent.exe] Error 1
> make[2]: Leaving directory `/usr/src/gnupg-1.9.20/tools'
> make[1]: *** [all-recursive] Error 1
> make[1]: Leaving directory `/usr/src/gnupg-1.9.20'
> make: *** [all] Error 2
> 
> Ok, we lack "pthread support" ?
[snip]

Wrong, it's not pthread support is pth as in portable threads, and obviously you
had just built it... the real problem is that the compile command is wrong, if
you try by hand the correct command it will work:

gcc -g -O2 -Wall -o gpg-connect-agent.exe  gpg-connect-agent.o no-libgcrypt.o
../jnlib/libjnlib.a ../common/libcommon.a ../gl/libgnu.a -lassuan -lpth
-lgpg-error -lintl -lz

The only difference is "-lpth" which is the output of "/usr/bin/pth-config
--libs" (or in your case /usr/local/bin/...).  So the problem was really an
error on the generated Makefile, you should report it to gnupg.

Regards.
-- 
René Berber


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: gpg-agent: only one trouble before succesfull building
  2006-06-11  0:30   ` René Berber
@ 2006-06-11 19:34     ` gabriele.mailing
  0 siblings, 0 replies; 3+ messages in thread
From: gabriele.mailing @ 2006-06-11 19:34 UTC (permalink / raw)
  To: cygwin

Renè,
thank you for your suggestions. I built pth-2.0.6.
It worked fine, but I had to add "-I/usr/local/include ".

> if you try by hand the correct command it will work:
> gcc -g -O2 -Wall -o gpg-connect-agent.exe  gpg-connect-agent.o no-libgcrypt.o
> ../jnlib/libjnlib.a ../common/libcommon.a ../gl/libgnu.a -lassuan -lpth
> -lgpg-error -lintl -lz
> The only difference is "-lpth" which is the output of "/usr/bin/pth-config
> --libs" (or in your case /usr/local/bin/...). 

So after the error, I made:
cd tools
gcc   -I/usr/local/include -g -O2 -Wall   -o gpg-connect-agent.exe
gpg-connect-agent.o no-libgcrypt.o ../jnlib/libjnlib.a
../common/libcommon.a ../gl/libgnu.a -L/usr/local/lib -lassuan
-lgpg-error -lintl -lz -lpth
cd ..
make

And the gpg-agent built good.

> So the problem was really an error on the generated Makefile,
> you should report it to gnupg.
>   
I'll do.

After building, I tried gpg-agent:

$ cd /usr/src/gnupg-1.9.20/agent
$ eval $(./gpg-agent --daemon)

Checked to be sure it is active:
$ ps -a | grep gpg-agent
      3012       1    3012       3012    ? 1005 16:52:40
/usr/src/gnupg-1.9.20/agent/gpg-agent

Checked that the environment is good:
$ set | grep GPG_AGENT
GPG_AGENT_INFO=/tmp/gpg-ptlT3p/S.gpg-agent:3012:

Checked that the socket is present:
$ ls /tmp/gpg-ptlT3p/
total 1
drwx------+ 2 mnt.vvngrl Nessuno  0 Jun 11 16:52 .
drwxrwxrwt+ 6 mnt.vvngrl Users    0 Jun 11 16:52 ..
srwxr-xr-x  1 mnt.vvngrl Nessuno 53 Jun 11 16:52 S.gpg-agent

So, to be sure to use official cygwin gpg:
$ gpg --version
gpg (GnuPG) 1.4.2.1
Copyright (C) 2005 Free Software Foundation, Inc.
This program comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it
under certain conditions. See the file COPYING for details.

Home: ~/.gnupg
Supported algorithms:
Pubkey: RSA, RSA-E, RSA-S, ELG-E, DSA
Cipher: 3DES, CAST5, BLOWFISH, AES, AES192, AES256, TWOFISH
Hash: MD5, SHA1, RIPEMD160, SHA256, SHA384, SHA512
Compression: Uncompressed, ZIP, ZLIB, BZIP2

Ok, let's do litte test:

$ echo "test" | gpg -ase -r 0xEFF5860B | gpg
gpg: WARNING: using insecure memory!
gpg: please see http://www.gnupg.org/faq.html for more information

You need a passphrase to unlock the secret key for
user: "Gabriele Vivinetto <gabriele.vivinetto@rvmgroup.it>"
1024-bit DSA key, ID E8FC81D7, created 2005-08-31

gpg: WARNING: using insecure memory!
gpg: please see http://www.gnupg.org/faq.html for more information
gpg: problem with the agent - disabling agent use
Enter passphrase:

Oh no...
*gpg: problem with the agent - disabling agent use*

May be official cygwin gpg lacks agent support ? How do I see if the gpg
executable is compiled with agent support ?
Ah, yes, I've tried the test, but another run of the test requested me
the password again.....

P.S. tried to build pinentry too, installed and run eval $(gpg-agent
--daemon --pinentry-program /usr/local/bin/pinentry) but same failure...

-- 
Diesis


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-06-11 19:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1149964625.8941.ezmlm@cygwin.com>
2006-06-10 20:13 ` gpg-agent: only one trouble before succesfull building gabriele.mailing
2006-06-11  0:30   ` René Berber
2006-06-11 19:34     ` gabriele.mailing

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).