Does now work with libgcrypt

This commit is contained in:
Werner Koch 2000-12-21 11:51:57 +00:00
parent 613c15be88
commit a1c48aede2
7 changed files with 44 additions and 294 deletions

8
README
View File

@ -10,12 +10,4 @@
Branch 1.0.x for real work. The next
stable release will be 1.2
This version has been released due to the included libgcrypt which is
used by GNUTLS and might be of use for other software too.
GPG itself does not work and will not be installed.

View File

@ -153,13 +153,6 @@ case "${target}" in
;;
esac
GNUPG_SYS_SYMBOL_UNDERSCORE
GNUPG_CHECK_PIC
GNUPG_CHECK_EXPORTDYNAMIC
if test "$NO_PIC" = yes; then
try_dynload=no
fi
case "${target}" in
*-*-mingw32*)
@ -170,7 +163,6 @@ case "${target}" in
;;
i?86-*-msdosdjgpp*)
PRINTABLE_OS_NAME="MSDOS/DJGPP"
try_dynload=no
;;
*-linux*)
PRINTABLE_OS_NAME="GNU/Linux"
@ -185,42 +177,6 @@ dnl let that after linux to avoid gnu-linux problems
esac
AC_DEFINE_UNQUOTED(PRINTABLE_OS_NAME, "$PRINTABLE_OS_NAME")
dnl Fixme: Are these the best flags for OpenBSD????
dnl (I have removed the -lc from * ...CFLAGS for test purposes.)
case "${target}" in
*-openbsd*)
NAME_OF_DEV_RANDOM="/dev/srandom"
NAME_OF_DEV_URANDOM="/dev/urandom"
DYNLINK_MOD_CFLAGS="-shared -rdynamic $CFLAGS_PIC -Wl,-Bshareable -Wl,-x"
;;
*-netbsd*)
NAME_OF_DEV_RANDOM="/dev/random"
NAME_OF_DEV_URANDOM="/dev/urandom"
DYNLINK_MOD_CFLAGS="-shared -rdynamic $CFLAGS_PIC -Wl,-Bshareable -Wl,-x"
;;
*-solaris*)
NAME_OF_DEV_RANDOM="/dev/random"
NAME_OF_DEV_URANDOM="/dev/random"
DYNLINK_MOD_CFLAGS="-shared $CFLAGS_PIC"
;;
*)
NAME_OF_DEV_RANDOM="/dev/random"
NAME_OF_DEV_URANDOM="/dev/urandom"
# -shared is a gcc-ism. Find pic flags from GNUPG_CHECK_PIC.
if test -n "$GCC" ; then
DYNLINK_MOD_CFLAGS="-shared $CFLAGS_PIC"
else
DYNLINK_MOD_CFLAGS="$CFLAGS_PIC"
fi
;;
esac
AC_DEFINE_UNQUOTED(NAME_OF_DEV_RANDOM, "$NAME_OF_DEV_RANDOM")
AC_DEFINE_UNQUOTED(NAME_OF_DEV_URANDOM, "$NAME_OF_DEV_URANDOM")
dnl Checks for libraries.
if test "$try_gettext" = yes; then
@ -232,6 +188,22 @@ AC_SUBST(USE_NLS)
AC_SUBST(USE_INCLUDED_LIBINTL)
fi
AC_PATH_PROG(LIBGCRYPT_CONFIG, libgcrypt-config)
if test -n "$LIBGCRYPT_CONFIG"; then
LIBGCRYPT_CFLAGS=`$LIBGCRYPT_CONFIG --cflags`
LIBGCRYPT_LIBS=`$LIBGCRYPT_CONFIG --libs`
else
AC_MSG_ERROR([[
***
*** You need libgcrypt to build this program.
*** It should be available at the same place you go this
*** software.
***]])
fi
AC_SUBST(LIBGCRYPT_CFLAGS)
AC_SUBST(LIBGCRYPT_LIBS)
dnl Where is the GTK+ toolkit
if test "$cross_compiling" = yes ; then
CFLAGS="$CFLAGS -I/home/wk/work/gtk+w32/include/gtk+/gdk/win32 \
@ -260,53 +232,6 @@ if test x$ac_try_nsl = x1; then
fi
if test "$try_dynload" = yes ; then
AC_CHECK_LIB(dl,dlopen)
if test "$ac_cv_lib_dl_dlopen" = "yes"; then
AC_DEFINE(USE_DYNAMIC_LINKING)
AC_DEFINE(HAVE_DL_DLOPEN)
DYNLINK_LDFLAGS="$CFLAGS_EXPORTDYNAMIC"
use_gnupg_extensions=yes
else
AC_CHECK_FUNCS(dlopen)
if test "$ac_cv_func_dlopen" = "yes"; then
AC_DEFINE(USE_DYNAMIC_LINKING)
AC_DEFINE(HAVE_DL_DLOPEN)
DYNLINK_LDFLAGS="$CFLAGS_EXPORTDYNAMIC"
use_gnupg_extensions=yes
else
AC_CHECK_LIB(dld,shl_load)
if test "$ac_cv_lib_dld_shl_load" = "yes"; then
AC_DEFINE(USE_DYNAMIC_LINKING)
AC_DEFINE(HAVE_DL_SHL_LOAD)
DYNLINK_LDFLAGS="$CFLAGS_EXPORTDYNAMIC"
use_gnupg_extensions=yes
dnl -----------------
dnl DLD is not ready for use. So I better disable this test
dnl
dnl AC_CHECK_LIB(dld,dld_link)
dnl if test "$ac_cv_lib_dld_dld_link" = "yes"; then
dnl AC_DEFINE(USE_DYNAMIC_LINKING)
dnl AC_DEFINE(HAVE_DLD_DLD_LINK)
dnl DYNLINK_LDFLAGS="$CFLAGS_EXPORTDYNAMIC"
dnl use_gnupg_extensions=yes
dnl ---------------
fi
fi
fi
else
AC_MSG_CHECKING(for dynamic loading)
DYNLINK_LDFLAGS=
DYNLINK_MOD_CFLAGS=
use_gnupg_extensions=no
AC_MSG_RESULT(has been disabled)
fi
AM_CONDITIONAL(ENABLE_GNUPG_EXTENSIONS, test "$use_gnupg_extensions" = yes )
AC_SUBST(DYNLINK_LDFLAGS)
AC_SUBST(DYNLINK_MOD_CFLAGS)
dnl Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS(unistd.h langinfo.h termio.h)
@ -385,170 +310,6 @@ if test "$ac_cv_header_sys_shm_h" = "yes"; then
AC_DEFINE(USE_SHM_COPROCESSING)
fi
dnl
dnl check whether we have a random device
dnl
if test "$try_dev_random" = yes ; then
AC_CACHE_CHECK(for random device, ac_cv_have_dev_random,
[if test -r "$NAME_OF_DEV_RANDOM" && test -r "$NAME_OF_DEV_URANDOM" ; then
ac_cv_have_dev_random=yes; else ac_cv_have_dev_random=no; fi])
if test "$ac_cv_have_dev_random" = yes; then
AC_DEFINE(HAVE_DEV_RANDOM)
fi
else
AC_MSG_CHECKING(for random device)
ac_cv_have_dev_random=no
AC_MSG_RESULT(has been disabled)
fi
dnl
dnl and whether this device supports ioctl
dnl (Note, that we should do a real test here)
dnl
if test "$ac_cv_have_dev_random" = yes ; then
AC_CHECK_HEADERS(linux/random.h)
AC_CACHE_CHECK(for random device ioctl, ac_cv_have_dev_random_ioctl,
[ if test "$ac_cv_header_linux_random_h" = yes ; then
ac_cv_have_dev_random_ioctl=yes;
else
ac_cv_have_dev_random_ioctl=no;
fi
])
if test "$ac_cv_have_dev_random_ioctl" = yes; then
AC_DEFINE(HAVE_DEV_RANDOM_IOCTL)
fi
fi
dnl
dnl Figure out the default linkage mode for cipher modules
dnl
print_egd_notice=no
if test "$use_static_rnd" = default; then
if test "$ac_cv_have_dev_random" = yes; then
static_random_module="rndlinux"
else
case "${target}" in
*-*-mingw32*)
static_random_module="rndw32"
AC_DEFINE(USE_STATIC_RNDW32)
;;
i?86-emx-os2|i?86-*-os2*emx)
static_random_module="rndos2"
;;
m68k-atari-mint)
static_random_module="rndatari"
;;
i?86-*-msdosdjgpp*)
:
;;
*)
static_random_module="rndunix"
print_egd_notice=yes
;;
esac
fi
else
if test "$use_static_rnd" = none; then
:
else
static_random_module="rnd$use_static_rnd"
if test "$use_static_rnd" = "unix"; then
print_egd_notice=yes
fi
fi
fi
if test "$print_egd_notice" = "yes"; then
AC_MSG_WARN([[
***
*** The performance of the UNIX random gatherer module is not very good
*** and it does not keep the entropy pool over multiple invocations of
*** GnuPG. The suggested way to overcome this problem is to use the
***
*** Entropy Gathering Daemon (EGD)
***
*** which provides a entropy source for the whole system. It is written
*** in Perl and available at the GnuPG FTP servers. For more information
*** consult the GnuPG webpages:
***
*** http://www.gnupg.org/download.html#egd
***
*** You may want to run ./configure with --enable-static-rnd=none to be
*** able to load the EGD client code dynamically; this way you can choose
*** between RNDUNIX and RNDEGD without recompilation.
***]])
fi
dnl
dnl Parse the modules list and build the list
dnl of static and dymically linked modules
dnl
dnl (We always need a static rmd160)
static_modules="$static_modules rmd160 $static_random_module"
STATIC_CIPHER_NAMES=""
STATIC_CIPHER_OBJS=""
DYNAMIC_CIPHER_MODS=""
GNUPG_MSG_PRINT([dynamically linked cipher modules:])
for name in $MODULES_IN_CIPHER; do
x="yes"
for i in $disallowed_modules; do
if test "$name" = "$i" ; then x="no" ; fi
done;
if test $x = yes; then
x="no"
for i in $static_modules; do
if test "$name" = "$i" ; then
x="yes"
fi
done;
if test $x = yes; then
STATIC_CIPHER_NAMES="$STATIC_CIPHER_NAMES $name"
STATIC_CIPHER_OBJS="$STATIC_CIPHER_OBJS $name.lo"
else
DYNAMIC_CIPHER_MODS="$DYNAMIC_CIPHER_MODS $name"
GNUPG_MSG_PRINT([$name])
fi
fi
done
AC_MSG_RESULT()
AC_SUBST(STATIC_CIPHER_OBJS)
AC_SUBST(STATIC_CIPHER_NAMES)
AC_SUBST(DYNAMIC_CIPHER_MODS)
dnl
dnl And build the constructor file
dnl
test -d cipher || mkdir cipher
cat <<G10EOF >cipher/construct.c
/* automatically generated by configure - do not edit */
G10EOF
GNUPG_MSG_PRINT([statically linked cipher modules:])
for name in $STATIC_CIPHER_NAMES; do
echo "void ${name}_constructor(void);" >>cipher/construct.c
GNUPG_MSG_PRINT([$name])
done
AC_MSG_RESULT()
cat <<G10EOF >>cipher/construct.c
void
cipher_modules_constructor(void)
{
static int done = 0;
if( done )
return;
done = 1;
G10EOF
for name in $STATIC_CIPHER_NAMES; do
echo " ${name}_constructor();" >>cipher/construct.c
done
echo '}' >>cipher/construct.c
dnl
dnl Do we have zlib? Must do it here because Solaris failed

View File

@ -1,6 +1,6 @@
## Process this file with automake to create Makefile.in
BUILT_SOURCES = version.sgml gcryptref.html gcryptref.ps
BUILT_SOURCES = version.sgml
#EXTRA_DIST = DETAILS gpg.sgml gpg.1 FAQ HACKING OpenPGP \
@ -12,9 +12,6 @@ EXTRA_DIST = DETAILS HACKING OpenPGP FAQ
### pkgdata_DATA = gcryptref.html gcryptref.ps
CLEANFILES = gcryptref.aux gcryptref.log gcryptref.tex gcryptref.dvi
# gcryptref.sgml : version.sgml

View File

@ -3,7 +3,7 @@
INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/intl
EXTRA_DIST = OPTIONS pubring.asc options.skel
OMIT_DEPENDENCIES = zlib.h zconf.h
LDFLAGS = -static @LDFLAGS@ @DYNLINK_LDFLAGS@ -lgcrypt
LDFLAGS = @LDFLAGS@ $(LIBGCRYPT_LIBS)
# we need to add libutil.la a second time because we have to resolve
# gpg_log_ in some libjnlib modules. - very ugly - should be removed soon.
needed_libs = ../util/libutil.a \

View File

@ -10,11 +10,11 @@ util/logger.c
jnlib/argparse.c
# cipher
cipher/random.c
cipher/rndlinux.c
#cipher/random.c
#cipher/rndlinux.c
# gcrypt
gcrypt/secmem.c
#gcrypt/secmem.c
# main program
@ -52,4 +52,3 @@ g10/encr-data.c
g10/seskey.c
g10/delkey.c
g10/helptext.c

View File

@ -7,7 +7,7 @@ DIE=no
autoconf_vers=2.13
automake_vers=1.4
aclocal_vers=1.4
libtool_vers=1.3
#libtool_vers=1.3
if (autoconf --version) < /dev/null > /dev/null 2>&1 ; then
if (autoconf --version | awk 'NR==1 { if( $3 >= '$autoconf_vers') \
@ -65,20 +65,20 @@ if (gettext --version </dev/null 2>/dev/null | awk 'NR==1 { split($4,A,"\."); \
fi
if (libtool --version) < /dev/null > /dev/null 2>&1 ; then
if (libtool --version | awk 'NR==1 { if( $4 >= '$libtool_vers') \
exit 1; exit 0; }');
then
echo "**Error**: "\`libtool\'" is too old."
echo ' (version ' $libtool_vers ' or newer is required)'
DIE="yes"
fi
else
echo
echo "**Error**: You must have "\`libtool\'" installed to compile $PGM."
echo ' (version ' $libtool_vers ' or newer is required)'
DIE="yes"
fi
#if (libtool --version) < /dev/null > /dev/null 2>&1 ; then
# if (libtool --version | awk 'NR==1 { if( $4 >= '$libtool_vers') \
# exit 1; exit 0; }');
# then
# echo "**Error**: "\`libtool\'" is too old."
# echo ' (version ' $libtool_vers ' or newer is required)'
# DIE="yes"
# fi
#else
# echo
# echo "**Error**: You must have "\`libtool\'" installed to compile $PGM."
# echo ' (version ' $libtool_vers ' or newer is required)'
# DIE="yes"
#fi
if test "$DIE" = "yes"; then
@ -87,8 +87,8 @@ fi
echo "Running gettextize... Ignore non-fatal messages."
echo "no" | gettextize --force
echo "Running libtoolize... Ignore non-fatal messages."
echo "no" | libtoolize
#echo "Running libtoolize... Ignore non-fatal messages."
#echo "no" | libtoolize
echo "Running aclocal..."

View File

@ -4,8 +4,9 @@ EXTRA_DIST = lspgpot mail-signed-keys ring-a-party
INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/intl
# we need to add libutil.la a second time because we have to resolve
# gpg_log_ in some libjnlib modules. - very ugly - should be removed soon.
needed_libs = ../util/libutil.a -lgcrypt \
../jnlib/libjnlib.a ../util/libutil.a @INTLLIBS@
needed_libs = ../util/libutil.a \
../jnlib/libjnlib.a ../util/libutil.a \
@INTLLIBS@
noinst_PROGRAMS = mpicalc bftest clean-sat mk-tdata shmtest
@ -19,10 +20,10 @@ mk_tdata_SOURCES = mk-tdata.c
shmtest_SOURCES = shmtest.c
mpicalc_LDADD = $(needed_libs)
bftest_LDADD = $(needed_libs)
mpicalc_LDADD = $(needed_libs) $(LIBGCRYPT_LIBS)
bftest_LDADD = $(needed_libs) $(LIBGCRYPT_LIBS)
shmtest_LDADD = $(needed_libs)
shmtest_LDADD = $(needed_libs) $(LIBGCRYPT_LIBS)
mpicalc bftest shmtest: $(needed_libs)