# configure.ac - for GnuPG 2.1
# Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
-# 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+# 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
#
# This file is part of GnuPG.
#
# sufficient.
development_version=no
-NEED_GPG_ERROR_VERSION=1.4
+NEED_GPG_ERROR_VERSION=1.8
NEED_LIBGCRYPT_API=1
NEED_LIBGCRYPT_VERSION=1.4.0
NEED_LIBASSUAN_VERSION=2.0.0
NEED_KSBA_API=1
-NEED_KSBA_VERSION=1.0.2
+NEED_KSBA_VERSION=1.1.0
PACKAGE=$PACKAGE_NAME
have_libusb=no
have_adns=no
+use_zip=yes
use_bzip2=yes
use_exec=yes
disable_keyserver_path=no
use_ccid_driver=yes
+use_standard_socket=yes
+dirmngr_auto_start=no
+
+try_ks_ldap=no
GNUPG_BUILD_PROGRAM(gpg, yes)
GNUPG_BUILD_PROGRAM(gpgsm, yes)
GNUPG_BUILD_PROGRAM(agent, yes)
GNUPG_BUILD_PROGRAM(scdaemon, yes)
GNUPG_BUILD_PROGRAM(g13, yes)
+GNUPG_BUILD_PROGRAM(dirmngr, yes)
GNUPG_BUILD_PROGRAM(tools, yes)
GNUPG_BUILD_PROGRAM(doc, yes)
GNUPG_BUILD_PROGRAM(symcryptrun, no)
+GNUPG_BUILD_PROGRAM(gpgtar, no)
AC_SUBST(PACKAGE)
AC_SUBST(PACKAGE_GT)
test -n "$GNUPG_PROTECT_TOOL_PGM" \
&& show_gnupg_protect_tool_pgm="$GNUPG_PROTECT_TOOL_PGM"
+AC_ARG_WITH(dirmngr-ldap-pgm,
+ [ --with-dirmngr-ldap-pgm=PATH Use PATH as the default for the dirmnge ldap wrapper)],
+ GNUPG_DIRMNGR_LDAP_PGM="$withval", GNUPG_DIRMNGR_LDAP_PGM="" )
+AC_SUBST(GNUPG_DIRMNGR_LDAP_PGM)
+AM_CONDITIONAL(GNUPG_DIRMNGR_LDAP_PGM, test -n "$GNUPG_DIRMNGR_LDAP_PGM")
+show_gnupg_dirmngr_ldap_pgm="(default)"
+test -n "$GNUPG_DIRMNGR_LDAP_PGM" \
+ && show_gnupg_dirmngr_ldap_pgm="$GNUPG_DIRMNGR_LDAP_PGM"
+
# Some folks want to use only the agent from this packet. Make it
# easier for them by providing the configure option
selinux_support=$enableval, selinux_support=no)
AC_MSG_RESULT($selinux_support)
+# Allow disabling of zip support.
+# This is in general not a good idea because according to rfc4880 OpenPGP
+# implementations SHOULD support ZLIB.
+AC_MSG_CHECKING([whether to enable the ZIP and ZLIB compression algorithm])
+AC_ARG_ENABLE(zip,
+ AC_HELP_STRING([--disable-zip],
+ [disable the ZIP and ZLIB compression algorithm]),
+ use_zip=$enableval)
+AC_MSG_RESULT($use_zip)
+
# Allow disabling of bzib2 support.
# It is defined only after we confirm the library is available later
AC_MSG_CHECKING([whether to enable the BZIP2 compression algorithm])
AC_MSG_CHECKING([whether LDAP keyserver support is requested])
AC_ARG_ENABLE(ldap,
AC_HELP_STRING([--disable-ldap],[disable LDAP keyserver interface only]),
- try_ldap=$enableval, try_ldap=yes)
- AC_MSG_RESULT($try_ldap)
+ try_ks_ldap=$enableval, try_ks_ldap=yes)
+ AC_MSG_RESULT($try_ks_ldap)
AC_MSG_CHECKING([whether HKP keyserver support is requested])
AC_ARG_ENABLE(hkp,
[enable email keyserver interface only]),
try_mailto=$enableval, try_mailto=no)
AC_MSG_RESULT($try_mailto)
- fi
+ fi
- AC_MSG_CHECKING([whether keyserver exec-path is enabled])
- AC_ARG_ENABLE(keyserver-path,
+ AC_MSG_CHECKING([whether keyserver exec-path is enabled])
+ AC_ARG_ENABLE(keyserver-path,
AC_HELP_STRING([--disable-keyserver-path],
[disable the exec-path option for keyserver helpers]),
[if test "$enableval" = no ; then
disable_keyserver_path=yes
fi],enableval=yes)
- AC_MSG_RESULT($enableval)
- fi
+ AC_MSG_RESULT($enableval)
+fi
#
use_ccid_driver=$enableval)
AC_MSG_RESULT($use_ccid_driver)
+#
+# Dirmngr is nowadays a system service and thus it usually does no
+# make sense to start it as needed. However on some systems this is
+# possible; this option enable the feature.
+#
+AC_MSG_CHECKING([whether to auto start dirmngr])
+AC_ARG_ENABLE(dirmngr-auto-start,
+ AC_HELP_STRING([--enable-dirmngr-auto-start],
+ [enable auto starting of the dirmngr]),
+ dirmngr_auto_start=$enableval)
+AC_MSG_RESULT($dirmngr_auto_start)
+if test "$dirmngr_auto_start" = yes ; then
+ AC_DEFINE(USE_DIRMNGR_AUTO_START,1,
+ [Define to enable auto starting of the dirmngr])
+fi
+
#
# To avoid double inclusion of config.h which might happen at some
#define SAFE_VERSION_DASH '-'
/* Some global constants. */
-#ifdef HAVE_DRIVE_LETTERS
-#define GNUPG_DEFAULT_HOMEDIR "c:/gnupg"
+#ifdef HAVE_DOSISH_SYSTEM
+# ifdef HAVE_DRIVE_LETTERS
+# define GNUPG_DEFAULT_HOMEDIR "c:/gnupg"
+# else
+# define GNUPG_DEFAULT_HOMEDIR "/gnupg"
+# endif
#elif defined(__VMS)
-#define GNUPG_DEFAULT_HOMEDIR "/SYS\$LOGIN/gnupg"
+#define GNUPG_DEFAULT_HOMEDIR "/SYS$LOGIN/gnupg"
#else
#define GNUPG_DEFAULT_HOMEDIR "~/.gnupg"
#endif
/* For some systems (DOS currently), we hardcode the path here. For
POSIX systems the values are constructed by the Makefiles, so that
the values may be overridden by the make invocations; this is to
- comply with the GNU coding standards. */
-#ifdef HAVE_DRIVE_LETTERS
- /* FIXME: We need to use a function to determine these values depending
- on the actual installation directory. */
-#define GNUPG_BINDIR "c:\\gnupg"
-#define GNUPG_LIBEXECDIR "c:\\gnupg"
-#define GNUPG_LIBDIR "c:\\gnupg"
-#define GNUPG_DATADIR "c:\\gnupg"
-#define GNUPG_SYSCONFDIR "c:\\gnupg"
+ comply with the GNU coding standards. Note that these values are
+ only defaults. */
+#ifdef HAVE_DOSISH_SYSTEM
+# ifdef HAVE_DRIVE_LETTERS
+# define GNUPG_BINDIR "c:\\gnupg"
+# define GNUPG_LIBEXECDIR "c:\\gnupg"
+# define GNUPG_LIBDIR "c:\\gnupg"
+# define GNUPG_DATADIR "c:\\gnupg"
+# define GNUPG_SYSCONFDIR "c:\\gnupg"
+# else
+# define GNUPG_BINDIR "\\gnupg"
+# define GNUPG_LIBEXECDIR "\\gnupg"
+# define GNUPG_LIBDIR "\\gnupg"
+# define GNUPG_DATADIR "\\gnupg"
+# define GNUPG_SYSCONFDIR "\\gnupg"
+# endif
#endif
/* Derive some other constants. */
/* Under Windows we use the gettext code from libgpg-error. */
#define GPG_ERR_ENABLE_GETTEXT_MACROS
+/* Under WindowsCE we use the strerror replacement from libgpg-error. */
+#define GPG_ERR_ENABLE_ERRNO_MACROS
+
#endif /*GNUPG_CONFIG_H_INCLUDED*/
])
AC_ISC_POSIX
gl_EARLY
AC_SYS_LARGEFILE
-GNUPG_CHECK_FAQPROG
GNUPG_CHECK_USTAR
# We need to compile and run a program on the build machine. A
# comment in libgpg-error says that the AC_PROG_CC_FOR_BUILD macro in
-# the AC archive is broken for autoconf 2.57. Given that tehre is no
+# the AC archive is broken for autoconf 2.57. Given that there is no
# newer version of that macro, we assume that it is also broken for
# autoconf 2.61 and thus we use a simple but usually sufficient
# approach.
have_w32_system=no
have_w32ce_system=no
use_simple_gettext=no
+use_ldapwrapper=yes
+mmap_needed=yes
case "${host}" in
*-mingw32*)
# special stuff for Windoze NT
ac_cv_have_dev_random=no
AC_DEFINE(USE_ONLY_8DOT3,1,
- [set this to limit filenames to the 8.3 format])
- AC_DEFINE(HAVE_DRIVE_LETTERS,1,
- [defined if we must run on a stupid file system])
+ [Set this to limit filenames to the 8.3 format])
AC_DEFINE(USE_SIMPLE_GETTEXT,1,
- [because the Unix gettext has too much overhead on
+ [Because the Unix gettext has too much overhead on
MingW32 systems and these systems lack Posix functions,
we use a simplified version of gettext])
disable_keyserver_path=yes
have_dosish_system=yes
have_w32_system=yes
- case "${host}" in *-mingw32ce*) have_w32ce_system=yes ;; esac
+ use_ldapwrapper=no # Fixme: Do this only for CE.
+ case "${host}" in
+ *-mingw32ce*)
+ have_w32ce_system=yes
+ ;;
+ *)
+ AC_DEFINE(HAVE_DRIVE_LETTERS,1,
+ [Defined if the OS supports drive letters.])
+ ;;
+ esac
try_gettext="no"
use_simple_gettext=yes
+ mmap_needed=no
;;
i?86-emx-os2 | i?86-*-os2*emx )
# OS/2 with the EMX environment
AC_DEFINE(HAVE_DOSISH_SYSTEM,1,
[Defined if we run on some of the PCDOS like systems
(DOS, Windoze. OS/2) with special properties like
- no file modes])
+ no file modes, case insensitive file names and preferred
+ use of backslashes as directory name separators.])
fi
AM_CONDITIONAL(HAVE_DOSISH_SYSTEM, test "$have_dosish_system" = yes)
AM_CONDITIONAL(HAVE_W32_SYSTEM, test "$have_w32_system" = yes)
AM_CONDITIONAL(HAVE_W32CE_SYSTEM, test "$have_w32ce_system" = yes)
+if test "$use_ldapwrapper" = yes; then
+ AC_DEFINE(USE_LDAPWRAPPER,1, [Build dirmngr with LDAP wrapper process])
+fi
+AM_CONDITIONAL(USE_LDAPWRAPPER, test "$use_ldapwrapper" = yes)
+
if test "$disable_keyserver_path" = yes; then
AC_DEFINE(DISABLE_KEYSERVER_PATH,1,
[Defined to disable exec-path for keyserver helpers])
fi
+#
+# Allows enabling the use of a standard socket by default This is
+# gpg-agent's option --[no-]use-standard-socket. For Windows we force
+# the use of this.
+#
+AC_MSG_CHECKING([whether to use a standard socket by default])
+AC_ARG_ENABLE(standard-socket,
+ AC_HELP_STRING([--disable-standard-socket],
+ [don't use a standard socket by default]),
+ use_standard_socket=$enableval)
+tmp=""
+if test "$use_standard_socket" != yes; then
+ if test "$have_w32_system" = yes; then
+ use_standard_socket=yes
+ tmp=" (forced)"
+ fi
+fi
+AC_MSG_RESULT($use_standard_socket$tmp)
+if test "$use_standard_socket" = yes; then
+ AC_DEFINE(USE_STANDARD_SOCKET,1,
+ [Use the standard socket for the agent by default])
+fi
+
+
# (These need to go after AC_PROG_CC so that $EXEEXT is defined)
AC_DEFINE_UNQUOTED(EXEEXT,"$EXEEXT",[The executable file extension, if any])
AC_DEFINE_UNQUOTED(FUSERMOUNT,
"${FUSERMOUNT}", [defines the filename of the fusermount program])
+
+# Checks for dirmngr
+
+
#
# Checks for symcryptrun:
#
# Check whether the GNU Pth library is available
# Note, that we include a Pth emulation for W32.
#
-GNUPG_PATH_PTH
+if test "$have_w32_system" = yes; then
+ GNUPG_PATH_PTH([2.0.4])
+else
+ GNUPG_PATH_PTH
+fi
if test "$have_pth" = "yes"; then
AC_DEFINE(USE_GNU_PTH, 1,
[Defined if the GNU Portable Thread Library should be used])
#
# Check for LDAP
#
-if test "$try_ldap" = yes ; then
+if test "$try_ks_ldap" = yes || test "$build_dirmngr" = "yes" ; then
GNUPG_CHECK_LDAP($NETLIBS)
fi
AC_CHECK_SIZEOF(unsigned int)
AC_CHECK_SIZEOF(unsigned long)
AC_CHECK_SIZEOF(unsigned long long)
+AC_HEADER_TIME
AC_CHECK_SIZEOF(time_t,,[[
#include <stdio.h>
#if TIME_WITH_SYS_TIME
# endif
#endif
]])
+GNUPG_TIME_T_UNSIGNED
# Ensure that we have UINT64_C before we bother to check for uint64_t
AC_FUNC_FSEEKO
AC_FUNC_VPRINTF
AC_FUNC_FORK
-AC_CHECK_FUNCS([strerror strlwr tcgetattr mmap])
-AC_CHECK_FUNCS([strcasecmp strncasecmp ctermid times gmtime_r])
-AC_CHECK_FUNCS([unsetenv fcntl ftruncate])
+AC_CHECK_FUNCS([strerror strlwr tcgetattr mmap canonicalize_file_name])
+AC_CHECK_FUNCS([strcasecmp strncasecmp ctermid times gmtime_r strtoull])
+AC_CHECK_FUNCS([unsetenv fcntl ftruncate canonicalize_file_name])
AC_CHECK_FUNCS([gettimeofday getrusage getrlimit setrlimit clock_gettime])
AC_CHECK_FUNCS([atexit raise getpagesize strftime nl_langinfo setlocale])
-AC_CHECK_FUNCS([waitpid wait4 sigaction sigprocmask pipe stat getaddrinfo])
-AC_CHECK_FUNCS([ttyname rand ftello fsync])
+AC_CHECK_FUNCS([waitpid wait4 sigaction sigprocmask pipe getaddrinfo])
+AC_CHECK_FUNCS([ttyname rand ftello fsync stat lstat])
AC_CHECK_TYPES([struct sigaction, sigset_t],,,[#include <signal.h>])
+# Dirmngr requires mmap on Unix systems.
+if test $ac_cv_func_mmap != yes -a $mmap_needed = yes; then
+ AC_MSG_ERROR([[Sorry, the current implemenation requires mmap.]])
+fi
+
#
# These are needed by the jnlib parts in common.
# Note: We already checked pwd.h.
AC_CHECK_FUNCS([memicmp stpcpy strsep strlwr strtoul memmove stricmp strtol \
memrchr isascii timegm getrusage setrlimit stat setlocale \
flockfile funlockfile fopencookie funopen getpwnam getpwuid \
- getenv ])
+ getenv inet_pton])
+# end jnlib checks.
+
+
#
# gnulib checks
# when compiling a conftest (due to the "-lz" from LIBS).
# Note that we combine zlib and bzlib2 in ZLIBS.
#
-_cppflags="${CPPFLAGS}"
-_ldflags="${LDFLAGS}"
-AC_ARG_WITH(zlib,
- [ --with-zlib=DIR use libz in DIR],[
- if test -d "$withval"; then
- CPPFLAGS="${CPPFLAGS} -I$withval/include"
- LDFLAGS="${LDFLAGS} -L$withval/lib"
- fi
- ])
+if test "$use_zip" = yes ; then
+ _cppflags="${CPPFLAGS}"
+ _ldflags="${LDFLAGS}"
+ AC_ARG_WITH(zlib,
+ [ --with-zlib=DIR use libz in DIR],[
+ if test -d "$withval"; then
+ CPPFLAGS="${CPPFLAGS} -I$withval/include"
+ LDFLAGS="${LDFLAGS} -L$withval/lib"
+ fi
+ ])
+
+ AC_CHECK_HEADER(zlib.h,
+ AC_CHECK_LIB(z, deflateInit2_,
+ ZLIBS="-lz",
+ CPPFLAGS=${_cppflags} LDFLAGS=${_ldflags}),
+ CPPFLAGS=${_cppflags} LDFLAGS=${_ldflags})
+
+ AC_DEFINE(HAVE_ZIP,1, [Defined if ZIP and ZLIB are supported])
+fi
-AC_CHECK_HEADER(zlib.h,
- AC_CHECK_LIB(z, deflateInit2_,
- ZLIBS="-lz",
- CPPFLAGS=${_cppflags} LDFLAGS=${_ldflags}),
- CPPFLAGS=${_cppflags} LDFLAGS=${_ldflags})
#
# Check whether we can support bzip2
# mysterious reasons - the final link step should bail out.
# W32SOCKLIBS is also defined so that if can be used for tools not
# requiring any network stuff but linking to code in libcommon which
-# tracks in winsock stuff (e.g. init_common_subsystems.
+# tracks in winsock stuff (e.g. init_common_subsystems).
if test "$have_w32_system" = yes; then
- W32SOCKLIBS="-lws2_32"
+ if test "$have_w32ce_system" = yes; then
+ W32SOCKLIBS="-lws2"
+ else
+ W32SOCKLIBS="-lws2_32"
+ fi
NETLIBS="${NETLIBS} ${W32SOCKLIBS}"
fi
build_doc=no
fi
-
-AM_CONDITIONAL(BUILD_GPG, test "$build_gpg" = "yes")
-AM_CONDITIONAL(BUILD_GPGSM, test "$build_gpgsm" = "yes")
-AM_CONDITIONAL(BUILD_AGENT, test "$build_agent" = "yes")
-AM_CONDITIONAL(BUILD_SCDAEMON, test "$build_scdaemon" = "yes")
-AM_CONDITIONAL(BUILD_G13, test "$build_g13" = "yes")
-AM_CONDITIONAL(BUILD_TOOLS, test "$build_tools" = "yes")
-AM_CONDITIONAL(BUILD_DOC, test "$build_doc" = "yes")
+#
+# Set variables for use by th automake makefile.
+#
+AM_CONDITIONAL(BUILD_GPG, test "$build_gpg" = "yes")
+AM_CONDITIONAL(BUILD_GPGSM, test "$build_gpgsm" = "yes")
+AM_CONDITIONAL(BUILD_AGENT, test "$build_agent" = "yes")
+AM_CONDITIONAL(BUILD_SCDAEMON, test "$build_scdaemon" = "yes")
+AM_CONDITIONAL(BUILD_G13, test "$build_g13" = "yes")
+AM_CONDITIONAL(BUILD_DIRMNGR, test "$build_dirmngr" = "yes")
+AM_CONDITIONAL(BUILD_TOOLS, test "$build_tools" = "yes")
+AM_CONDITIONAL(BUILD_DOC, test "$build_doc" = "yes")
AM_CONDITIONAL(BUILD_SYMCRYPTRUN, test "$build_symcryptrun" = "yes")
+AM_CONDITIONAL(BUILD_GPGTAR, test "$build_gpgtar" = "yes")
AM_CONDITIONAL(RUN_GPG_TESTS,
- test x$cross_compiling = xno -a "$build_gpg" = yes )
+ test x$cross_compiling = xno -a "$build_gpg" = yes )
+
+#
+# Set some defines for use gpgconf.
+#
+if test "$build_gpg" = yes ; then
+ AC_DEFINE(BUILD_WITH_GPG,1,[Defined if GPG is to be build])
+fi
+if test "$build_gpgsm" = yes ; then
+ AC_DEFINE(BUILD_WITH_GPGSM,1,[Defined if GPGSM is to be build])
+fi
+if test "$build_agent" = yes ; then
+ AC_DEFINE(BUILD_WITH_AGENT,1,[Defined if GPG-AGENT is to be build])
+fi
+if test "$build_scdaemon" = yes ; then
+ AC_DEFINE(BUILD_WITH_SCDAEMON,1,[Defined if SCDAEMON is to be build])
+fi
+if test "$build_dirmngr" = yes ; then
+ AC_DEFINE(BUILD_WITH_DIRMNGR,1,[Defined if SCDAEMON is to be build])
+fi
+if test "$build_g13" = yes ; then
+ AC_DEFINE(BUILD_WITH_G13,1,[Defined if G13 is to be build])
+fi
+
#
*** (at least version $NEED_KSBA_VERSION using API $NEED_KSBA_API is required).
***]])
fi
+if test "$gnupg_have_ldap" = "no"; then
+ die=yes
+ AC_MSG_NOTICE([[
+***
+*** You need a LDAP library to build this program.
+*** Check out
+*** http://www.openldap.org
+*** for a suitable implementation.
+***]])
+ if test "$have_w32ce_system" = yes; then
+ AC_MSG_NOTICE([[
+*** Note that CeGCC might be broken, a package fixing this is:
+*** http://files.kolab.org/local/windows-ce/
+*** source/wldap32_0.1-mingw32ce.orig.tar.gz
+*** binary/wldap32-ce-arm-dev_0.1-1_all.deb
+***]])
+ fi
+fi
if test "$missing_pth" = "yes"; then
AC_MSG_NOTICE([[
***
agent/Makefile
scd/Makefile
g13/Makefile
+dirmngr/Makefile
keyserver/Makefile
keyserver/gpg2keys_mailto
keyserver/gpg2keys_test
Agent: $build_agent $build_agent_threaded
Smartcard: $build_scdaemon $build_scdaemon_extra
G13: $build_g13
-
+ Dirmngr: $build_dirmngr
+ Gpgtar: $build_gpgtar
Protect tool: $show_gnupg_protect_tool_pgm
+ LDAP wrapper: $show_gnupg_dirmngr_ldap_pgm
Default agent: $show_gnupg_agent_pgm
Default pinentry: $show_gnupg_pinentry_pgm
Default scdaemon: $show_gnupg_scdaemon_pgm
Default dirmngr: $show_gnupg_dirmngr_pgm
+
+ Use standard socket: $use_standard_socket
+ Dirmngr auto start: $dirmngr_auto_start
"
if test x"$use_regex" != xyes ; then
echo "