aboutsummaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorMarcus Brinkmann <[email protected]>2009-10-20 15:39:15 +0000
committerMarcus Brinkmann <[email protected]>2009-10-20 15:39:15 +0000
commite782b1ab06a2d3325bc487c28ab678c95d9675b3 (patch)
tree87aacb82e59e4d7d8b60d2c55d66b12eed01af2e /configure.ac
parentAdd new debug helper (diff)
downloadgpgme-e782b1ab06a2d3325bc487c28ab678c95d9675b3.tar.gz
gpgme-e782b1ab06a2d3325bc487c28ab678c95d9675b3.zip
2009-10-20 Marcus Brinkmann <[email protected]>
* configure.ac: Replace internal libassuan by external libassuan. * m4/libassuan.m4: New file. * Makefile.am (assuan): Remove variable. (SUBDIRS): Remove ${assuan}. * assuan/: Removed. src/ 2009-10-20 Marcus Brinkmann <[email protected]> * Makefile.am (assuan_cppflags, assuan_libobjs): Removed. (gpgsm_components): Move engine-assuan.c to ... (assuan_components): ... this new variable. (main_sources): Add this new variable. (AM_CPPFLAGS): Remove $(assuan_cppflags). (AM_CFLAGS): Add @LIBASSUAN_CFLAGS@. (libgpgme_la_DEPENDENCIES, libgpgme_pth_la_DEPENDENCIES) (libgpgme_glib_la_DEPENDENCIES, libgpgme_qt_la_DEPENDENCIES) (libgpgme_pthread_la_DEPENDENCIES): Remove $(assuan_libobjs). (libgpgme_la_LIBADD, libgpgme_pth_la_LIBADD) (libgpgme_glib_la_LIBADD, libgpgme_qt_la_LIBADD)) (libgpgme_pthread_la_LIBADD): Replace $(assuan_libobjs) by @LIBASSUAN_LIBS@. * priv-io.h [!HAVE_W32_SYSTEM]: Declare _gpgme_io_recvmsg, _gpgme_io_sendmsg, _gpgme_io_waitpid. * engine-backend.h: Define with [ENABLE_ASSUAN] instead of [ENABLE_GPGSM]. * posix-io.c (_gpgme_io_waitpid): Make non-static. * util.h (ENABLE_ASSUAN): Declar _gpgme_assuan_system_hooks, _gpgme_assuan_malloc_hooks, _gpgme_assuan_log_cb. * engine-gpgsm.c: Don't map assuan error codes. Use assuan_release instead of assuan_disconnect. (map_assuan_error): Remove function. (gpgsm_new): Use new assuan context interface. * engine-assuan.c: Use assuan_release instead of assuan_disconnect. (llass_new): Use new assuan context interface.
Diffstat (limited to '')
-rw-r--r--configure.ac85
1 files changed, 42 insertions, 43 deletions
diff --git a/configure.ac b/configure.ac
index 9459c37e..9e0c3251 100644
--- a/configure.ac
+++ b/configure.ac
@@ -188,8 +188,10 @@ AM_CONDITIONAL(HAVE_PTH, test "$have_pth" = "yes")
AM_CONDITIONAL(HAVE_PTHREAD, test "$have_pthread" = "yes")
+
# Checks for header files.
AC_CHECK_HEADERS(sys/select.h)
+AC_CHECK_HEADERS([sys/uio.h])
# Type checks.
@@ -219,13 +221,6 @@ if test "$GCC" = yes; then
fi
fi
-# Network library fun.
-AC_CHECK_FUNC(gethostbyname, , AC_CHECK_LIB(nsl, gethostbyname,
- [NETLIBS="-lnsl $NETLIBS"]))
-AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt,
- [NETLIBS="-lsocket $NETLIBS"]))
-AC_SUBST(NETLIBS)
-
# Checks for library functions.
AC_FUNC_FSEEKO
@@ -277,7 +272,15 @@ AM_PATH_GPG_ERROR(1.4,, AC_MSG_ERROR([libgpg-error was not found]))
AC_DEFINE(GPG_ERR_SOURCE_DEFAULT, GPG_ERR_SOURCE_GPGME,
[The default error source for GPGME.])
-
+# And for libassuan.
+NEED_LIBASSUAN_VERSION=1.1.0
+have_libassuan=no
+AM_PATH_LIBASSUAN("$NEED_LIBASSUAN_VERSION",
+ have_libassuan=yes, have_libassuan=no)
+AM_CONDITIONAL(HAVE_ASSUAN, test "$have_libassuan" = "yes")
+if test "$have_libassuan" = "yes"; then
+ AC_DEFINE(ENABLE_ASSUAN,1,[Whether Assuan support is enabled])
+fi
# Checks for system services
NEED_GPG_VERSION_DEFAULT=1.3.0
@@ -510,6 +513,12 @@ AC_ARG_ENABLE(gpgsm-test,
run_gpgsm_test=$enableval)
AM_CONDITIONAL(RUN_GPGSM_TESTS, test "$run_gpgsm_test" = "yes")
+# Require libassuan if GPGSM is here.
+require_libassuan=no
+if test "$GPGSM" != "no"; then
+ require_libassuan=yes
+fi
+
NO_OVERRIDE=no
AC_ARG_WITH(gpgconf,
@@ -614,13 +623,6 @@ if test "$GPGCONF" != "no"; then
fi
-# FIXME: Only build if supported.
-AM_CONDITIONAL(BUILD_ASSUAN, test "$GPGSM" != "no")
-if test "$GPGSM" != "no"; then
- AC_DEFINE(HAVE_ASSUAN_H, 1,
- [Defined if we are building with assuan support.])
-fi
-
# Check for funopen
AC_CHECK_FUNCS(funopen)
if test $ac_cv_func_funopen != yes; then
@@ -636,18 +638,12 @@ if test $ac_cv_func_funopen != yes; then
fi
fi
-# More assuan replacement functions.
-AC_REPLACE_FUNCS(isascii)
-AC_REPLACE_FUNCS(putc_unlocked)
-AC_REPLACE_FUNCS(memrchr)
+# Replacement functions.
AC_REPLACE_FUNCS(stpcpy)
# Check for unistd.h for setenv replacement function.
AC_CHECK_HEADERS(unistd.h)
AC_REPLACE_FUNCS(setenv)
-# More assuan checks.
-AC_CHECK_HEADERS([sys/uio.h])
-
# Assuan check for descriptor passing.
AC_CHECK_MEMBER(struct cmsghdr.cmsg_len,
[supports_descriptor_passing=yes],
@@ -684,27 +680,6 @@ fi
AM_CONDITIONAL(USE_DESCRIPTOR_PASSING, test "$use_descriptor_passing" = "yes")
-# Assuan check for the getsockopt SO_PEERCRED
-AC_MSG_CHECKING(for SO_PEERCRED)
-AC_CACHE_VAL(assuan_cv_sys_so_peercred,
- [AC_TRY_COMPILE([#include <sys/socket.h>],
- [struct ucred cr;
- int cl = sizeof cr;
- getsockopt (1, SOL_SOCKET, SO_PEERCRED, &cr, &cl);],
- assuan_cv_sys_so_peercred=yes,
- assuan_cv_sys_so_peercred=no)
- ])
-AC_MSG_RESULT($assuan_cv_sys_so_peercred)
-if test $assuan_cv_sys_so_peercred = yes; then
- AC_DEFINE(HAVE_SO_PEERCRED, 1,
- [Defined if SO_PEERCRED is supported (Linux specific)])
-fi
-
-if test "$have_w32_system" = yes; then
- NETLIBS="-lws2_32 $NETLIBS"
-fi
-
-# End of assuan checks.
AM_CONDITIONAL(BUILD_COMPLUS, test "$component_system" = "COM+")
@@ -753,6 +728,28 @@ LTLIBOBJS=`echo "$LIB@&t@OBJS" |
sed 's,\.[[^.]]* ,.lo ,g;s,\.[[^.]]*$,.lo,'`
AC_SUBST(LTLIBOBJS)
+# Last check.
+die=no
+if test "$require_libassuan" = "no"; then
+ die=yes
+ AC_MSG_NOTICE([[
+***
+*** You need libassuan to build this program with GPGSM support.
+*** This library is for example available at
+*** ftp://ftp.gnupg.org/pub/gcrypt/alpha/libassuan/
+*** (at least version $NEED_LIBASSUAN_VERSION is required).
+***]])
+fi
+
+if test "$die" = "yes"; then
+ AC_MSG_ERROR([[
+***
+*** Required libraries not found. Please consult the above messages
+*** and install them before running configure again.
+***]])
+fi
+
+
#
# Create config files
@@ -780,6 +777,8 @@ echo "
GpgConf path: $GPGCONF
GpgConf version: $GPGCONF_VERSION, min. $NEED_GPGCONF_VERSION
+ Assuan version: $LIBASSUAN_VERSION
+
GPGME Pthread: $have_pthread
GPGME Pth: $have_pth
"