mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-14 21:47:19 +02:00
Does now work with libgcrypt
This commit is contained in:
parent
613c15be88
commit
a1c48aede2
7 changed files with 44 additions and 294 deletions
271
configure.in
271
configure.in
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue