Apply the patch gnupg-1.4.9.patch to the GnuPG sources. Before running the configure and isntallation steps, you need to place some symbolic links in the sources. Compiling libgpgcrypt on z/OS runs afoul of a limitation of the XLC compiler's include header search path and system headers. Issue the following commands, verbatim, to overcome this limitation:
cd mpi ln -s ../include/mpi.h . ln -s ../include/memory.h . cd -
Then:
./configure CC=xlc CFLAGS="-qchars=signed -qascii -q64 -qlanglvl=extc99 -qexportall -qrent -qnocsect -W l,DLL -D_XOPEN_SOURCE=600 -D_ENHANCED_ASCII_EXT=0xFFFFFFFF -D_IEEEV1_COMPATIBILITY -D_OPEN_MSGQ_EXT" LD=xlc LDFLAGS="-qascii -q64 -W l,DLL" CXX=xlc++ --without-pth --without-libassuan --without-ksba --prefix=/usr/local
make && make check
(as root) make install