1 # configure.ac for GPGME
2 # Copyright (C) 2000 Werner Koch (dd9jn)
3 # Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007 g10 Code GmbH
5 # This file is part of GPGME.
7 # GPGME is free software; you can redistribute it and/or modify it
8 # under the terms of the GNU Lesser General Public License as
9 # published by the Free Software Foundation; either version 2.1 of the
10 # License, or (at your option) any later version.
12 # GPGME is distributed in the hope that it will be useful, but WITHOUT
13 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14 # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
15 # Public License for more details.
17 # You should have received a copy of the GNU Lesser General Public
18 # License along with this program; if not, write to the Free Software
19 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
21 # (Process this file with autoconf to produce a configure script.)
23 min_automake_version="1.9.3"
25 # Version number: Remember to change it immediately *after* a release.
26 # Make sure to run "svn up" and "./autogen.sh --force"
27 # before a "make dist". See below for the LT versions.
29 # The SVN version is usually the next intended release version with
30 # the string "-svnNNN" appended. The reason for this is that tests for a
31 # specific feature can already be done under the assumption that the
32 # SVN version is the most recent one in a branch. To disable the SVN
33 # version for the real release, set the my_issvn macro to no.
34 m4_define(my_version, [1.1.7])
35 m4_define(my_issvn, [yes])
37 m4_define([svn_revision], m4_esyscmd([echo -n $( (svn info 2>/dev/null \
38 || echo 'Revision: 0')|sed -n '/^Revision:/ {s/[^0-9]//gp;q;}')]))
39 AC_INIT([gpgme], my_version[]m4_if(my_issvn,[yes],[-svn[]svn_revision]),
40 [bug-gpgme@gnupg.org])
43 # LT Version numbers, remember to change them just *before* a release.
44 # (Code changed: REVISION++)
45 # (Interfaces added/removed/changed: CURRENT++, REVISION=0)
46 # (Interfaces added: AGE++)
47 # (Interfaces removed/changed: AGE=0)
49 LIBGPGME_LT_CURRENT=17
50 # Subtract 2 from this value if you want to make the LFS transition an
51 # ABI break. [Note to self: Remove this comment with the next regular break.]
53 LIBGPGME_LT_REVISION=4
55 # If the API is changed in an incompatible way: increment the next counter.
56 GPGME_CONFIG_API_VERSION=1
57 ##############################################
60 BUILD_REVISION=svn_revision
62 VERSION=$PACKAGE_VERSION
64 AC_CONFIG_SRCDIR(gpgme/gpgme.h)
65 dnl FIXME: Enable this with autoconf 2.59.
66 dnl AC_CONFIG_MACRO_DIR(m4)
67 AM_CONFIG_HEADER(config.h)
68 AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
72 # Enable GNU extensions on systems that have them.
75 AH_VERBATIM([_REENTRANT],
76 [/* To allow the use of GPGME in multithreaded programs we have to use
77 special features from the library.
78 IMPORTANT: gpgme is not yet fully reentrant and you should use it
79 only from one thread. */
87 AC_SUBST(LIBGPGME_LT_CURRENT)
88 AC_SUBST(LIBGPGME_LT_AGE)
89 AC_SUBST(LIBGPGME_LT_REVISION)
93 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of this package])
94 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version of this package])
96 # Don't default to build static libs.
102 # For now we hardcode the use of version scripts. It would be better
103 # to write a test for this or even implement this within libtool.
104 have_ld_version_script=no
107 have_ld_version_script=yes
110 have_ld_version_script=yes
113 AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, test "$have_ld_version_script" = "yes")
118 component_system=None
119 have_dosish_system=no
125 # special stuff for Windoze NT
126 have_dosish_system=yes
128 GPG_DEFAULT='c:\\gnupg\\gpg.exe'
129 GPGSM_DEFAULT='c:\\gnupg\\gpgsm.exe'
130 GPGCONF_DEFAULT='c:\\gnupg\\gpgconf.exe'
131 #component_system='COM+'
134 AC_ARG_ENABLE(w32-glib,
135 AC_HELP_STRING([--enable-w32-glib], [build GPGME Glib for W32]),
136 build_w32_glib=$enableval)
138 # Check disabled, because the qt-dev packages in gpg4win do
139 # not provide any support for cross compilation.
140 # PKG_CHECK_MODULES(QT4_CORE, QtCore)
143 # ./configure --enable-w32-qt QT4_CORE_CFLAGS="..." QT4_CORE_LIBS="..."
144 AC_SUBST(QT4_CORE_CFLAGS)
145 AC_SUBST(QT4_CORE_LIBS)
146 AC_ARG_ENABLE(w32-qt,
147 AC_HELP_STRING([--enable-w32-qt], [build GPGME Qt for W32]),
148 build_w32_qt=$enableval)
151 AC_CHECK_PTH(1.2.0,,,no,have_pth=yes)
152 if test "$have_pth" = yes; then
153 AC_DEFINE(HAVE_PTH, ,[Define if we have Pth.])
155 AC_CHECK_LIB(pthread,pthread_create,have_pthread=yes)
156 if test "$have_pthread" = yes; then
157 AC_DEFINE(HAVE_PTHREAD, ,[Define if we have pthread.])
160 # XXX: Probably use exec-prefix here?
161 # GPG_DEFAULT='/usr/bin/gpg'
162 # GPGSM_DEFAULT='/usr/bin/gpgsm'
163 # GPGCONF_DEFAULT='/usr/bin/gpgconf'
167 if test "$have_dosish_system" = yes; then
168 AC_DEFINE(HAVE_DOSISH_SYSTEM,1,
169 [Defined if we run on some of the PCDOS like systems
170 (DOS, Windoze. OS/2) with special properties like
173 AM_CONDITIONAL(HAVE_DOSISH_SYSTEM, test "$have_dosish_system" = yes)
175 if test "$have_w32_system" = yes; then
176 AC_DEFINE(HAVE_W32_SYSTEM,1, [Defined if we run on a W32 API based system])
178 AM_CONDITIONAL(HAVE_W32_SYSTEM, test "$have_w32_system" = yes)
179 AM_CONDITIONAL(BUILD_W32_GLIB, test "$build_w32_glib" = yes)
180 AM_CONDITIONAL(BUILD_W32_QT, test "$build_w32_qt" = yes)
182 AM_CONDITIONAL(HAVE_PTH, test "$have_pth" = "yes")
183 AM_CONDITIONAL(HAVE_PTHREAD, test "$have_pthread" = "yes")
186 # Checks for header files.
187 AC_CHECK_HEADERS(sys/select.h)
192 AC_CHECK_SIZEOF(unsigned int)
196 # Checks for compiler features.
197 if test "$GCC" = yes; then
198 CFLAGS="$CFLAGS -Wall -Wcast-align -Wshadow -Wstrict-prototypes"
199 if test "$have_w32_system" = yes; then
200 CFLAGS="$CFLAGS -mms-bitfields"
204 # Network library fun.
205 AC_CHECK_FUNC(gethostbyname, , AC_CHECK_LIB(nsl, gethostbyname,
206 [NETLIBS="-lnsl $NETLIBS"]))
207 AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt,
208 [NETLIBS="-lsocket $NETLIBS"]))
211 # Checks for library functions.
214 AC_REPLACE_FUNCS(vasprintf)
215 if test "$ac_cv_func_vasprintf" != yes; then
219 # Try to find a thread-safe version of ttyname().
220 AC_REPLACE_FUNCS(ttyname_r)
221 if test "$ac_cv_func_ttyname_r" != yes; then
224 *** ttyname() is not thread-safe and ttyname_r() does not exist
228 # Try to find a thread-safe version of getenv().
229 have_thread_safe_getenv=no
231 if test $GLIBC21 = yes; then
232 have_thread_safe_getenv=yes
234 if test $have_thread_safe_getenv = yes; then
235 AC_DEFINE(HAVE_THREAD_SAFE_GETENV, [1], [Define if getenv() is thread-safe])
238 AC_CHECK_FUNCS(getenv_r, have_getenv_r=yes)
239 if test $have_getenv_r = no && test $have_thread_safe_getenv = no; then
242 *** getenv() is not thread-safe and getenv_r() does not exist
246 # For converting time strings to seconds since Epoch, we need the timegm
248 AC_CHECK_FUNCS(timegm)
249 if test "$ac_cv_func_timegm" != yes; then
252 *** timegm() not available - a non-thread-safe kludge will be used
253 *** and the TZ variable might be changed at runtime.
257 # Checking for libgpg-error.
258 AM_PATH_GPG_ERROR(1.4,, AC_MSG_ERROR([libgpg-error was not found]))
259 AC_DEFINE(GPG_ERR_SOURCE_DEFAULT, GPG_ERR_SOURCE_GPGME,
260 [The default error source for GPGME.])
264 # Checks for system services
265 NEED_GPG_VERSION_DEFAULT=1.3.0
266 NEED_GPGSM_VERSION_DEFAULT=1.9.6
267 NEED_GPGCONF_VERSION_DEFAULT=2.0.4
268 NEED_GPG_VERSION="$NEED_GPG_VERSION_DEFAULT"
269 NEED_GPGSM_VERSION="$NEED_GPGSM_VERSION_DEFAULT"
270 NEED_GPGCONF_VERSION="$NEED_GPGCONF_VERSION_DEFAULT"
271 AC_ARG_WITH(gpg-version,
272 AC_HELP_STRING([--with-gpg-version=VER], [require GnuPG version VER]),
273 NEED_GPG_VERSION=$withval)
274 if test "$NEED_GPG_VERSION" = "yes"; then
275 NEED_GPG_VERSION="$NEED_GPG_VERSION_DEFAULT"
277 if test "$NEED_GPG_VERSION" = "no"; then
278 NEED_GPG_VERSION=0.0.0
280 AC_ARG_WITH(gpgsm-version,
281 AC_HELP_STRING([--with-gpgsm-version=VER], [require GPGSM version VER]),
282 NEED_GPGSM_VERSION=$withval)
283 if test "$NEED_GPGSM_VERSION" = "yes"; then
284 NEED_GPGSM_VERSION="$NEED_GPGSM_VERSION_DEFAULT"
286 if test "$NEED_GPGSM_VERSION" = "no"; then
287 NEED_GPGSM_VERSION=0.0.0
289 AC_ARG_WITH(gpgconf-version,
290 AC_HELP_STRING([--with-gpgconf-version=VER], [require GPGCONF version VER]),
291 NEED_GPGCONF_VERSION=$withval)
292 if test "$NEED_GPGCONF_VERSION" = "yes"; then
293 NEED_GPGCONF_VERSION="$NEED_GPGCONF_VERSION_DEFAULT"
295 if test "$NEED_GPGCONF_VERSION" = "no"; then
296 NEED_GPGCONF_VERSION=0.0.0
299 AC_DEFINE_UNQUOTED(NEED_GPG_VERSION, "$NEED_GPG_VERSION",
300 [Min. needed GnuPG version.])
301 AC_DEFINE_UNQUOTED(NEED_GPGSM_VERSION, "$NEED_GPGSM_VERSION",
302 [Min. needed GPGSM version.])
303 AC_DEFINE_UNQUOTED(NEED_GPGCONF_VERSION, "$NEED_GPGCONF_VERSION",
304 [Min. needed GPGCONF version.])
309 AC_HELP_STRING([--with-gpg=PATH], [use GnuPG binary at PATH]),
310 GPG=$withval, NO_OVERRIDE=yes)
311 if test "$NO_OVERRIDE" = "yes" || test "$GPG" = "yes"; then
314 if test "$cross_compiling" != "yes"; then
315 AC_PATH_PROG(GPG, gpg)
317 if test -z "$GPG"; then
321 if test "$GPG" = no; then
322 if test "$NO_OVERRIDE" = "yes"; then
323 if test "$cross_compiling" != "yes"; then
326 *** Could not find GnuPG, install GnuPG or use --with-gpg=PATH to enable it
331 *** Can not determine path to GnuPG when cross-compiling, use --with-gpg=PATH
336 AC_DEFINE_UNQUOTED(GPG_PATH, "$GPG", [Path to the GnuPG binary.])
339 dnl Check for GnuPG version requirement.
342 if test -z "$GPG" -o "x$GPG" = "xno"; then
345 if test "$cross_compiling" = "yes"; then
346 AC_MSG_WARN([GnuPG version can not be checked when cross compiling])
349 if test ! -x "$GPG"; then
350 AC_MSG_WARN([GnuPG not executable, version check disabled])
355 if test "$ok" = "maybe"; then
356 AC_MSG_CHECKING(for GPG >= $NEED_GPG_VERSION)
357 req_major=`echo $NEED_GPG_VERSION | \
358 sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\1/'`
359 req_minor=`echo $NEED_GPG_VERSION | \
360 sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\2/'`
361 req_micro=`echo $NEED_GPG_VERSION | \
362 sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'`
363 GPG_VERSION=`$GPG --version | sed -n '1 s/[[^0-9]]*\(.*\)/\1/p'`
364 major=`echo $GPG_VERSION | \
365 sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'`
366 minor=`echo $GPG_VERSION | \
367 sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\2/'`
368 micro=`echo $GPG_VERSION | \
369 sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\3/'`
371 if test "$major" -gt "$req_major"; then
374 if test "$major" -eq "$req_major"; then
375 if test "$minor" -gt "$req_minor"; then
378 if test "$minor" -eq "$req_minor"; then
379 if test "$micro" -ge "$req_micro"; then
386 if test "$ok" = "yes"; then
390 AC_MSG_WARN([GPG must be at least version $NEED_GPG_VERSION])
394 AC_ARG_ENABLE(gpg-test,
395 AC_HELP_STRING([--disable-gpg-test], [disable GPG run test]),
396 run_gpg_test=$enableval)
397 AM_CONDITIONAL(RUN_GPG_TESTS, test "$run_gpg_test" = "yes")
402 AC_HELP_STRING([--with-gpgsm=PATH], [use GpgSM binary at PATH]),
403 GPGSM=$withval, NO_OVERRIDE=yes)
404 if test "$NO_OVERRIDE" = "yes" || test "$GPGSM" = "yes"; then
407 if test "$cross_compiling" != "yes"; then
408 AC_PATH_PROG(GPGSM, gpgsm)
410 if test -z "$GPGSM"; then
411 GPGSM="$GPGSM_DEFAULT"
414 if test "$GPGSM" = no; then
415 if test "$NO_OVERRIDE" = "yes"; then
416 if test "$cross_compiling" != "yes"; then
419 *** Could not find GpgSM, install GpgSM or use --with-gpgsm=PATH to enable it
424 *** Can not determine path to GpgSM when cross-compiling, use --with-gpgsm=PATH
429 AC_DEFINE_UNQUOTED(GPGSM_PATH, "$GPGSM", [Path to the GPGSM binary.])
430 AC_DEFINE(ENABLE_GPGSM,1,[Whether GPGSM support is enabled])
432 AM_CONDITIONAL(HAVE_GPGSM, test "$GPGSM" != "no")
435 dnl Check for GPGSM version requirement.
436 GPGSM_VERSION=unknown
438 if test -z "$GPGSM" -o "x$GPGSM" = "xno"; then
441 if test "$cross_compiling" = "yes"; then
442 AC_MSG_WARN([GPGSM version can not be checked when cross compiling])
445 if test ! -x "$GPGSM"; then
446 AC_MSG_WARN([GPGSM not executable, version check disabled])
451 if test "$ok" = "maybe"; then
452 AC_MSG_CHECKING(for GPGSM >= $NEED_GPGSM_VERSION)
453 req_major=`echo $NEED_GPGSM_VERSION | \
454 sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\1/'`
455 req_minor=`echo $NEED_GPGSM_VERSION | \
456 sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\2/'`
457 req_micro=`echo $NEED_GPGSM_VERSION | \
458 sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'`
459 GPGSM_VERSION=`$GPGSM --version | sed -n '1 s/[[^0-9]]*\(.*\)/\1/p'`
460 major=`echo $GPGSM_VERSION | \
461 sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'`
462 minor=`echo $GPGSM_VERSION | \
463 sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\2/'`
464 micro=`echo $GPGSM_VERSION | \
465 sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\3/'`
467 if test "$major" -gt "$req_major"; then
470 if test "$major" -eq "$req_major"; then
471 if test "$minor" -gt "$req_minor"; then
474 if test "$minor" -eq "$req_minor"; then
475 if test "$micro" -ge "$req_micro"; then
482 if test "$ok" = "yes"; then
486 AC_MSG_WARN([GPGSM must be at least version $NEED_GPGSM_VERSION])
490 AC_ARG_ENABLE(gpgsm-test,
491 AC_HELP_STRING([--disable-gpgsm-test], [disable GPGSM run test]),
492 run_gpgsm_test=$enableval)
493 AM_CONDITIONAL(RUN_GPGSM_TESTS, test "$run_gpgsm_test" = "yes")
498 AC_HELP_STRING([--with-gpgconf=PATH],
499 [use gpgconf binary at PATH]),
500 GPGCONF=$withval, NO_OVERRIDE=yes)
501 if test "$NO_OVERRIDE" = "yes" || test "$GPGCONF" = "yes"; then
504 if test "$cross_compiling" != "yes"; then
505 AC_PATH_PROG(GPGCONF, gpgconf)
507 if test -z "$GPGCONF"; then
508 GPGCONF="$GPGCONF_DEFAULT"
511 if test "$GPGCONF" = no; then
512 if test "$NO_OVERRIDE" = "yes"; then
513 if test "$cross_compiling" != "yes"; then
516 *** Could not find gpgconf, install gpgconf or use --with-gpgconf=PATH to enable it
521 *** Can not determine path to gpgconf when cross-compiling, use --with-gpgconf=PATH
526 AC_DEFINE_UNQUOTED(GPGCONF_PATH, "$GPGCONF", [Path to the GPGCONF binary.])
527 AC_DEFINE(ENABLE_GPGCONF,1,[Whether GPGCONF support is enabled])
529 AM_CONDITIONAL(HAVE_GPGCONF, test "$GPGCONF" != "no")
531 dnl Check for GPGCONF version requirement.
532 GPGCONF_VERSION=unknown
534 if test -z "$GPGCONF" -o "x$GPGCONF" = "xno"; then
537 if test "$cross_compiling" = "yes"; then
538 AC_MSG_WARN([GPGCONF version can not be checked when cross compiling])
541 if test ! -x "$GPGCONF"; then
542 AC_MSG_WARN([GPGCONF not executable, version check disabled])
547 if test "$ok" = "maybe"; then
548 AC_MSG_CHECKING(for GPGCONF >= $NEED_GPGCONF_VERSION)
549 req_major=`echo $NEED_GPGCONF_VERSION | \
550 sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\1/'`
551 req_minor=`echo $NEED_GPGCONF_VERSION | \
552 sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\2/'`
553 req_micro=`echo $NEED_GPGCONF_VERSION | \
554 sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'`
555 GPGCONF_VERSION=`$GPGCONF --version | sed -n '1 s/[[^0-9]]*\(.*\)/\1/p'`
556 major=`echo $GPGCONF_VERSION | \
557 sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'`
558 minor=`echo $GPGCONF_VERSION | \
559 sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\2/'`
560 micro=`echo $GPGCONF_VERSION | \
561 sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\3/'`
563 if test "$major" -gt "$req_major"; then
566 if test "$major" -eq "$req_major"; then
567 if test "$minor" -gt "$req_minor"; then
570 if test "$minor" -eq "$req_minor"; then
571 if test "$micro" -ge "$req_micro"; then
578 if test "$ok" = "yes"; then
582 AC_MSG_WARN([GPGCONF must be at least version $NEED_GPGCONF_VERSION])
585 run_gpgconf_test="$ok"
586 AC_ARG_ENABLE(gpgconf-test,
587 AC_HELP_STRING([--disable-gpgconf-test], [disable GPGCONF run test]),
588 run_gpgconf_test=$enableval)
589 AM_CONDITIONAL(RUN_GPGCONF_TESTS, test "$run_gpgconf_test" = "yes")
591 # Only build if supported.
592 AM_CONDITIONAL(BUILD_GPGCONF, test "$GPGCONF" != "no")
593 if test "$GPGCONF" != "no"; then
594 AC_DEFINE(HAVE_GPGCONF, 1,
595 [Defined if we are building with gpgconf support.])
599 # FIXME: Only build if supported.
600 AM_CONDITIONAL(BUILD_ASSUAN, test "$GPGSM" != "no")
601 if test "$GPGSM" != "no"; then
602 AC_DEFINE(HAVE_ASSUAN_H, 1,
603 [Defined if we are building with assuan support.])
607 AC_CHECK_FUNCS(funopen)
608 if test $ac_cv_func_funopen != yes; then
609 # No funopen but we can implement that in terms of fopencookie.
610 AC_CHECK_FUNCS(fopencookie)
611 if test $ac_cv_func_fopencookie = yes; then
612 AC_REPLACE_FUNCS(funopen)
616 *** No implementation of fopencookie or funopen available
621 # More assuan replacement functions.
622 AC_REPLACE_FUNCS(isascii)
623 AC_REPLACE_FUNCS(putc_unlocked)
624 AC_REPLACE_FUNCS(memrchr)
625 AC_REPLACE_FUNCS(stpcpy)
626 # Check for unistd.h for setenv replacement function.
627 AC_CHECK_HEADERS(unistd.h)
628 AC_REPLACE_FUNCS(setenv)
630 # More assuan checks.
631 AC_CHECK_HEADERS([sys/uio.h])
633 # Assuan check for descriptor passing.
634 AC_CHECK_MEMBER(struct cmsghdr.cmsg_len,
635 [supports_descriptor_passing=yes],
636 [supports_descriptor_passing=no
639 *** Data structure for sending ancillary data missing.
640 *** Descriptor passing won't work.
645 #include <sys/types.h>
646 #include <sys/socket.h>
654 AC_ARG_ENABLE(fd-passing,
655 AC_HELP_STRING([--enable-fd-passing], [use FD passing if supported]),
656 use_descriptor_passing=$enableval)
658 if test "$supports_descriptor_passing" != "yes"; then
659 use_descriptor_passing=no
662 if test "$use_descriptor_passing" = "yes"; then
663 AC_DEFINE(USE_DESCRIPTOR_PASSING,1,
664 [Defined if descriptor passing is enabled and supported])
667 AM_CONDITIONAL(USE_DESCRIPTOR_PASSING, test "$use_descriptor_passing" = "yes")
669 # Assuan check for the getsockopt SO_PEERCRED
670 AC_MSG_CHECKING(for SO_PEERCRED)
671 AC_CACHE_VAL(assuan_cv_sys_so_peercred,
672 [AC_TRY_COMPILE([#include <sys/socket.h>],
675 getsockopt (1, SOL_SOCKET, SO_PEERCRED, &cr, &cl);],
676 assuan_cv_sys_so_peercred=yes,
677 assuan_cv_sys_so_peercred=no)
679 AC_MSG_RESULT($assuan_cv_sys_so_peercred)
680 if test $assuan_cv_sys_so_peercred = yes; then
681 AC_DEFINE(HAVE_SO_PEERCRED, 1,
682 [Defined if SO_PEERCRED is supported (Linux specific)])
685 if test "$have_w32_system" = yes; then
686 NETLIBS="-lws2_32 $NETLIBS"
689 # End of assuan checks.
691 AM_CONDITIONAL(BUILD_COMPLUS, test "$component_system" = "COM+")
693 # Make the version number in gpgme/gpgme.h the same as the one here.
694 # (this is easier than to have a *.in file just for one substitution)
695 GNUPG_FIX_HDR_VERSION(gpgme/gpgme.h, GPGME_VERSION)
697 # Generate values for the DLL version info
698 if test "$have_w32_system" = yes; then
699 BUILD_TIMESTAMP=`date --iso-8601=minutes`
701 BUILD_FILEVERSION=`echo "$VERSION" | sed 's/\([0-9.]*\).*/\1./;s/\./,/g'`
703 BUILD_FILEVERSION="${BUILD_FILEVERSION}${BUILD_REVISION}"
705 AC_SUBST(BUILD_REVISION)
706 AC_SUBST(BUILD_TIMESTAMP)
707 AC_SUBST(BUILD_FILEVERSION)
709 # Add a few constants to help porting to W32
710 AH_VERBATIM([SEPCONSTANTS],
712 /* Separators as used in $PATH. */
713 #ifdef HAVE_DOSISH_SYSTEM
714 #define PATHSEP_C ';'
716 #define PATHSEP_C ':'
721 /* Definition of GCC specific attributes. */
723 # define GPGME_GCC_A_PURE __attribute__ ((__pure__))
725 # define GPGME_GCC_A_PURE
730 # Substitution used for gpgme-config
731 GPGME_CONFIG_LIBS="-lgpgme"
732 GPGME_CONFIG_CFLAGS=""
733 AC_SUBST(GPGME_CONFIG_API_VERSION)
734 AC_SUBST(GPGME_CONFIG_LIBS)
735 AC_SUBST(GPGME_CONFIG_CFLAGS)
738 LTLIBOBJS=`echo "$LIB@&t@OBJS" |
739 sed 's,\.[[^.]]* ,.lo ,g;s,\.[[^.]]*$,.lo,'`
743 # Create config files
745 AC_CONFIG_FILES(Makefile assuan/Makefile gpgme/Makefile
746 tests/Makefile tests/gpg/Makefile tests/gpgsm/Makefile
747 doc/Makefile complus/Makefile
748 gpgme/versioninfo.rc)
749 AC_CONFIG_FILES(gpgme/gpgme-config, chmod +x gpgme/gpgme-config)
750 AC_CONFIG_FILES([lang/Makefile lang/cl/Makefile lang/cl/gpgme.asd])
754 GPGME v${VERSION} has been configured as follows:
757 GnuPG version: $GPG_VERSION, min. $NEED_GPG_VERSION
760 GpgSM version: $GPGSM_VERSION, min. $NEED_GPGSM_VERSION
762 GpgConf path: $GPGCONF
763 GpgConf version: $GPGCONF_VERSION, min. $NEED_GPGCONF_VERSION
765 GPGME Pthread: $have_pthread