1 # configure.ac for GPGME
2 # Copyright (C) 2000 Werner Koch (dd9jn)
3 # Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 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.10"
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.2.1])
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;}')]))
40 [my_version[]m4_if(my_issvn,[yes],[-svn[]svn_revision])],
41 [bug-gpgme@gnupg.org])
44 # LT Version numbers, remember to change them just *before* a release.
45 # (Code changed: REVISION++)
46 # (Interfaces added/removed/changed: CURRENT++, REVISION=0)
47 # (Interfaces added: AGE++)
48 # (Interfaces removed/changed: AGE=0)
50 LIBGPGME_LT_CURRENT=18
51 # Subtract 2 from this value if you want to make the LFS transition an
52 # ABI break. [Note to self: Remove this comment with the next regular break.]
54 LIBGPGME_LT_REVISION=0
56 # If the API is changed in an incompatible way: increment the next counter.
57 GPGME_CONFIG_API_VERSION=1
58 ##############################################
61 BUILD_REVISION=svn_revision
63 VERSION=$PACKAGE_VERSION
65 AC_CONFIG_SRCDIR(src/gpgme.h.in)
66 dnl FIXME: Enable this with autoconf 2.59.
67 dnl AC_CONFIG_MACRO_DIR(m4)
68 AM_CONFIG_HEADER(config.h)
69 AC_CONFIG_MACRO_DIR([m4])
70 AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
74 # Enable GNU extensions on systems that have them.
77 AH_VERBATIM([_REENTRANT],
78 [/* To allow the use of GPGME in multithreaded programs we have to use
79 special features from the library.
80 IMPORTANT: gpgme is not yet fully reentrant and you should use it
81 only from one thread. */
89 AC_SUBST(LIBGPGME_LT_CURRENT)
90 AC_SUBST(LIBGPGME_LT_AGE)
91 AC_SUBST(LIBGPGME_LT_REVISION)
95 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of this package])
96 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version of this package])
98 # Don't default to build static libs.
100 LT_INIT([win32-dll disable-static])
101 LT_LANG([Windows Resource])
103 # For now we hardcode the use of version scripts. It would be better
104 # to write a test for this or even implement this within libtool.
105 have_ld_version_script=no
108 have_ld_version_script=yes
111 have_ld_version_script=yes
114 AC_DEFINE(_XOPEN_SOURCE, 500, Activate POSIX interface on MacOS X)
118 AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, test "$have_ld_version_script" = "yes")
124 component_system=None
125 have_dosish_system=no
131 # special stuff for Windoze NT
132 have_dosish_system=yes
134 GPG_DEFAULT='c:\\gnupg\\gpg.exe'
135 GPGSM_DEFAULT='c:\\gnupg\\gpgsm.exe'
136 GPGCONF_DEFAULT='c:\\gnupg\\gpgconf.exe'
137 G13_DEFAULT='c:\\gnupg\\g13.exe'
138 #component_system='COM+'
141 AC_ARG_ENABLE(w32-glib,
142 AC_HELP_STRING([--enable-w32-glib], [build GPGME Glib for W32]),
143 build_w32_glib=$enableval)
145 # Check disabled, because the qt-dev packages in gpg4win do
146 # not provide any support for cross compilation.
147 # PKG_CHECK_MODULES(QT4_CORE, QtCore)
150 # ./configure --enable-w32-qt QT4_CORE_CFLAGS="..." QT4_CORE_LIBS="..."
151 AC_SUBST(QT4_CORE_CFLAGS)
152 AC_SUBST(QT4_CORE_LIBS)
153 AC_ARG_ENABLE(w32-qt,
154 AC_HELP_STRING([--enable-w32-qt], [build GPGME Qt for W32]),
155 build_w32_qt=$enableval)
158 AC_CHECK_PTH(1.2.0,,,no,have_pth=yes)
159 if test "$have_pth" = yes; then
160 AC_DEFINE(HAVE_PTH, ,[Define if we have Pth.])
162 AC_CHECK_LIB(pthread,pthread_create,have_pthread=yes)
163 if test "$have_pthread" = yes; then
164 AC_DEFINE(HAVE_PTHREAD, ,[Define if we have pthread.])
167 # XXX: Probably use exec-prefix here?
168 # GPG_DEFAULT='/usr/bin/gpg'
169 # GPGSM_DEFAULT='/usr/bin/gpgsm'
170 # GPGCONF_DEFAULT='/usr/bin/gpgconf'
171 # G13_DEFAULT='/usr/bin/g13'
175 if test "$have_dosish_system" = yes; then
176 AC_DEFINE(HAVE_DOSISH_SYSTEM,1,
177 [Defined if we run on some of the PCDOS like systems
178 (DOS, Windoze. OS/2) with special properties like
181 AM_CONDITIONAL(HAVE_DOSISH_SYSTEM, test "$have_dosish_system" = yes)
183 if test "$have_w32_system" = yes; then
184 AC_DEFINE(HAVE_W32_SYSTEM,1, [Defined if we run on a W32 API based system])
186 AM_CONDITIONAL(HAVE_W32_SYSTEM, test "$have_w32_system" = yes)
187 AM_CONDITIONAL(BUILD_W32_GLIB, test "$build_w32_glib" = yes)
188 AM_CONDITIONAL(BUILD_W32_QT, test "$build_w32_qt" = yes)
190 AM_CONDITIONAL(HAVE_PTH, test "$have_pth" = "yes")
191 AM_CONDITIONAL(HAVE_PTHREAD, test "$have_pthread" = "yes")
195 # Checks for header files.
196 AC_CHECK_HEADERS(sys/select.h)
197 AC_CHECK_HEADERS([sys/uio.h])
202 AC_CHECK_SIZEOF(unsigned int)
207 # A simple compile time check in gpgme.h for GNU/Linux systems that
208 # prevents a file offset bits mismatch between gpgme and the application.
209 NEED__FILE_OFFSET_BITS=0
210 case "$ac_cv_sys_file_offset_bits" in
211 "" | no | unknown) ;;
213 NEED__FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits
216 AC_SUBST(NEED__FILE_OFFSET_BITS)
219 # Checks for compiler features.
220 if test "$GCC" = yes; then
221 CFLAGS="$CFLAGS -Wall -Wcast-align -Wshadow -Wstrict-prototypes"
222 if test "$have_w32_system" = yes; then
223 CFLAGS="$CFLAGS -mms-bitfields"
227 # Checks for library functions.
230 AC_REPLACE_FUNCS(vasprintf)
231 if test "$ac_cv_func_vasprintf" != yes; then
235 # Try to find a thread-safe version of ttyname().
236 AC_REPLACE_FUNCS(ttyname_r)
237 if test "$ac_cv_func_ttyname_r" != yes; then
240 *** ttyname() is not thread-safe and ttyname_r() does not exist
244 # Try to find a thread-safe version of getenv().
245 have_thread_safe_getenv=no
247 if test $GLIBC21 = yes; then
248 have_thread_safe_getenv=yes
250 if test $have_thread_safe_getenv = yes; then
251 AC_DEFINE(HAVE_THREAD_SAFE_GETENV, [1], [Define if getenv() is thread-safe])
254 AC_CHECK_FUNCS(getenv_r, have_getenv_r=yes)
255 if test $have_getenv_r = no && test $have_thread_safe_getenv = no; then
258 *** getenv() is not thread-safe and getenv_r() does not exist
262 # For converting time strings to seconds since Epoch, we need the timegm
264 AC_CHECK_FUNCS(timegm)
265 if test "$ac_cv_func_timegm" != yes; then
268 *** timegm() not available - a non-thread-safe kludge will be used
269 *** and the TZ variable might be changed at runtime.
273 # Checking for libgpg-error.
274 AM_PATH_GPG_ERROR(1.4,, AC_MSG_ERROR([libgpg-error was not found]))
275 AC_DEFINE(GPG_ERR_SOURCE_DEFAULT, GPG_ERR_SOURCE_GPGME,
276 [The default error source for GPGME.])
279 NEED_LIBASSUAN_VERSION=1.1.0
281 AM_PATH_LIBASSUAN("$NEED_LIBASSUAN_VERSION",
282 have_libassuan=yes, have_libassuan=no)
283 AM_CONDITIONAL(HAVE_ASSUAN, test "$have_libassuan" = "yes")
284 if test "$have_libassuan" = "yes"; then
285 AC_DEFINE(ENABLE_ASSUAN,1,[Whether Assuan support is enabled])
288 # Checks for system services
289 NEED_GPG_VERSION_DEFAULT=1.4.0
290 NEED_GPGSM_VERSION_DEFAULT=1.9.6
291 NEED_GPGCONF_VERSION_DEFAULT=2.0.4
292 NEED_G13_VERSION_DEFAULT=2.1.0
293 NEED_GPG_VERSION="$NEED_GPG_VERSION_DEFAULT"
294 NEED_GPGSM_VERSION="$NEED_GPGSM_VERSION_DEFAULT"
295 NEED_GPGCONF_VERSION="$NEED_GPGCONF_VERSION_DEFAULT"
296 NEED_G13_VERSION="$NEED_G13_VERSION_DEFAULT"
297 AC_ARG_WITH(gpg-version,
298 AC_HELP_STRING([--with-gpg-version=VER], [require GnuPG version VER]),
299 NEED_GPG_VERSION=$withval)
300 if test "$NEED_GPG_VERSION" = "yes"; then
301 NEED_GPG_VERSION="$NEED_GPG_VERSION_DEFAULT"
303 if test "$NEED_GPG_VERSION" = "no"; then
304 NEED_GPG_VERSION=0.0.0
306 AC_ARG_WITH(gpgsm-version,
307 AC_HELP_STRING([--with-gpgsm-version=VER], [require GPGSM version VER]),
308 NEED_GPGSM_VERSION=$withval)
309 if test "$NEED_GPGSM_VERSION" = "yes"; then
310 NEED_GPGSM_VERSION="$NEED_GPGSM_VERSION_DEFAULT"
312 if test "$NEED_GPGSM_VERSION" = "no"; then
313 NEED_GPGSM_VERSION=0.0.0
315 AC_ARG_WITH(gpgconf-version,
316 AC_HELP_STRING([--with-gpgconf-version=VER], [require GPGCONF version VER]),
317 NEED_GPGCONF_VERSION=$withval)
318 if test "$NEED_GPGCONF_VERSION" = "yes"; then
319 NEED_GPGCONF_VERSION="$NEED_GPGCONF_VERSION_DEFAULT"
321 if test "$NEED_GPGCONF_VERSION" = "no"; then
322 NEED_GPGCONF_VERSION=0.0.0
324 AC_ARG_WITH(g13-version,
325 AC_HELP_STRING([--with-g13-version=VER], [require G13 version VER]),
326 NEED_G13_VERSION=$withval)
327 if test "$NEED_G13_VERSION" = "yes"; then
328 NEED_G13_VERSION="$NEED_G13_VERSION_DEFAULT"
330 if test "$NEED_G13_VERSION" = "no"; then
331 NEED_G13_VERSION=0.0.0
334 AC_DEFINE_UNQUOTED(NEED_GPG_VERSION, "$NEED_GPG_VERSION",
335 [Min. needed GnuPG version.])
336 AC_DEFINE_UNQUOTED(NEED_GPGSM_VERSION, "$NEED_GPGSM_VERSION",
337 [Min. needed GPGSM version.])
338 AC_DEFINE_UNQUOTED(NEED_GPGCONF_VERSION, "$NEED_GPGCONF_VERSION",
339 [Min. needed GPGCONF version.])
340 AC_DEFINE_UNQUOTED(NEED_G13_VERSION, "$NEED_G13_VERSION",
341 [Min. needed G13 version.])
346 AC_HELP_STRING([--with-gpg=PATH], [use GnuPG binary at PATH]),
347 GPG=$withval, NO_OVERRIDE=yes)
348 if test "$NO_OVERRIDE" = "yes" || test "$GPG" = "yes"; then
351 if test "$cross_compiling" != "yes"; then
352 AC_PATH_PROG(GPG, gpg)
354 if test -z "$GPG"; then
358 if test "$GPG" = no; then
359 if test "$NO_OVERRIDE" = "yes"; then
360 if test "$cross_compiling" != "yes"; then
363 *** Could not find GnuPG, install GnuPG or use --with-gpg=PATH to enable it
368 *** Can not determine path to GnuPG when cross-compiling, use --with-gpg=PATH
373 AC_DEFINE_UNQUOTED(GPG_PATH, "$GPG", [Path to the GnuPG binary.])
376 dnl Check for GnuPG version requirement.
379 if test -z "$GPG" -o "x$GPG" = "xno"; then
382 if test "$cross_compiling" = "yes"; then
383 AC_MSG_WARN([GnuPG version can not be checked when cross compiling])
386 if test ! -x "$GPG"; then
387 AC_MSG_WARN([GnuPG not executable, version check disabled])
392 if test "$ok" = "maybe"; then
393 AC_MSG_CHECKING(for GPG >= $NEED_GPG_VERSION)
394 req_major=`echo $NEED_GPG_VERSION | \
395 sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\1/'`
396 req_minor=`echo $NEED_GPG_VERSION | \
397 sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\2/'`
398 req_micro=`echo $NEED_GPG_VERSION | \
399 sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'`
400 GPG_VERSION=`$GPG --version | sed -n '1 s/[[^0-9]]*\(.*\)/\1/p'`
401 major=`echo $GPG_VERSION | \
402 sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'`
403 minor=`echo $GPG_VERSION | \
404 sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\2/'`
405 micro=`echo $GPG_VERSION | \
406 sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\3/'`
408 if test "$major" -gt "$req_major"; then
411 if test "$major" -eq "$req_major"; then
412 if test "$minor" -gt "$req_minor"; then
415 if test "$minor" -eq "$req_minor"; then
416 if test "$micro" -ge "$req_micro"; then
423 if test "$ok" = "yes"; then
427 AC_MSG_WARN([GPG must be at least version $NEED_GPG_VERSION])
431 AC_ARG_ENABLE(gpg-test,
432 AC_HELP_STRING([--disable-gpg-test], [disable GPG run test]),
433 run_gpg_test=$enableval)
434 AM_CONDITIONAL(RUN_GPG_TESTS, test "$run_gpg_test" = "yes")
439 AC_HELP_STRING([--with-gpgsm=PATH], [use GpgSM binary at PATH]),
440 GPGSM=$withval, NO_OVERRIDE=yes)
441 if test "$NO_OVERRIDE" = "yes" || test "$GPGSM" = "yes"; then
444 if test "$cross_compiling" != "yes"; then
445 AC_PATH_PROG(GPGSM, gpgsm)
447 if test -z "$GPGSM"; then
448 GPGSM="$GPGSM_DEFAULT"
451 if test "$GPGSM" = no; then
452 if test "$NO_OVERRIDE" = "yes"; then
453 if test "$cross_compiling" != "yes"; then
456 *** Could not find GpgSM, install GpgSM or use --with-gpgsm=PATH to enable it
461 *** Can not determine path to GpgSM when cross-compiling, use --with-gpgsm=PATH
466 AC_DEFINE_UNQUOTED(GPGSM_PATH, "$GPGSM", [Path to the GPGSM binary.])
467 AC_DEFINE(ENABLE_GPGSM,1,[Whether GPGSM support is enabled])
469 AM_CONDITIONAL(HAVE_GPGSM, test "$GPGSM" != "no")
472 dnl Check for GPGSM version requirement.
473 GPGSM_VERSION=unknown
475 if test -z "$GPGSM" -o "x$GPGSM" = "xno"; then
478 if test "$cross_compiling" = "yes"; then
479 AC_MSG_WARN([GPGSM version can not be checked when cross compiling])
482 if test ! -x "$GPGSM"; then
483 AC_MSG_WARN([GPGSM not executable, version check disabled])
488 if test "$ok" = "maybe"; then
489 AC_MSG_CHECKING(for GPGSM >= $NEED_GPGSM_VERSION)
490 req_major=`echo $NEED_GPGSM_VERSION | \
491 sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\1/'`
492 req_minor=`echo $NEED_GPGSM_VERSION | \
493 sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\2/'`
494 req_micro=`echo $NEED_GPGSM_VERSION | \
495 sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'`
496 GPGSM_VERSION=`$GPGSM --version | sed -n '1 s/[[^0-9]]*\(.*\)/\1/p'`
497 major=`echo $GPGSM_VERSION | \
498 sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'`
499 minor=`echo $GPGSM_VERSION | \
500 sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\2/'`
501 micro=`echo $GPGSM_VERSION | \
502 sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\3/'`
504 if test "$major" -gt "$req_major"; then
507 if test "$major" -eq "$req_major"; then
508 if test "$minor" -gt "$req_minor"; then
511 if test "$minor" -eq "$req_minor"; then
512 if test "$micro" -ge "$req_micro"; then
519 if test "$ok" = "yes"; then
523 AC_MSG_WARN([GPGSM must be at least version $NEED_GPGSM_VERSION])
527 AC_ARG_ENABLE(gpgsm-test,
528 AC_HELP_STRING([--disable-gpgsm-test], [disable GPGSM run test]),
529 run_gpgsm_test=$enableval)
530 AM_CONDITIONAL(RUN_GPGSM_TESTS, test "$run_gpgsm_test" = "yes")
532 # Require libassuan if GPGSM is here.
534 if test "$GPGSM" != "no"; then
535 require_libassuan=yes
537 if test "$G13" != "no"; then
538 require_libassuan=yes
544 AC_HELP_STRING([--with-gpgconf=PATH],
545 [use gpgconf binary at PATH]),
546 GPGCONF=$withval, NO_OVERRIDE=yes)
547 if test "$NO_OVERRIDE" = "yes" || test "$GPGCONF" = "yes"; then
550 if test "$cross_compiling" != "yes"; then
551 AC_PATH_PROG(GPGCONF, gpgconf)
553 if test -z "$GPGCONF"; then
554 GPGCONF="$GPGCONF_DEFAULT"
557 if test "$GPGCONF" = no; then
558 if test "$NO_OVERRIDE" = "yes"; then
559 if test "$cross_compiling" != "yes"; then
562 *** Could not find gpgconf, install gpgconf or use --with-gpgconf=PATH to enable it
567 *** Can not determine path to gpgconf when cross-compiling, use --with-gpgconf=PATH
572 AC_DEFINE_UNQUOTED(GPGCONF_PATH, "$GPGCONF", [Path to the GPGCONF binary.])
573 AC_DEFINE(ENABLE_GPGCONF,1,[Whether GPGCONF support is enabled])
575 AM_CONDITIONAL(HAVE_GPGCONF, test "$GPGCONF" != "no")
577 dnl Check for GPGCONF version requirement.
578 GPGCONF_VERSION=unknown
580 if test -z "$GPGCONF" -o "x$GPGCONF" = "xno"; then
583 if test "$cross_compiling" = "yes"; then
584 AC_MSG_WARN([GPGCONF version can not be checked when cross compiling])
587 if test ! -x "$GPGCONF"; then
588 AC_MSG_WARN([GPGCONF not executable, version check disabled])
593 if test "$ok" = "maybe"; then
594 AC_MSG_CHECKING(for GPGCONF >= $NEED_GPGCONF_VERSION)
595 req_major=`echo $NEED_GPGCONF_VERSION | \
596 sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\1/'`
597 req_minor=`echo $NEED_GPGCONF_VERSION | \
598 sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\2/'`
599 req_micro=`echo $NEED_GPGCONF_VERSION | \
600 sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'`
601 GPGCONF_VERSION=`$GPGCONF --version | sed -n '1 s/[[^0-9]]*\(.*\)/\1/p'`
602 major=`echo $GPGCONF_VERSION | \
603 sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'`
604 minor=`echo $GPGCONF_VERSION | \
605 sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\2/'`
606 micro=`echo $GPGCONF_VERSION | \
607 sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\3/'`
609 if test "$major" -gt "$req_major"; then
612 if test "$major" -eq "$req_major"; then
613 if test "$minor" -gt "$req_minor"; then
616 if test "$minor" -eq "$req_minor"; then
617 if test "$micro" -ge "$req_micro"; then
624 if test "$ok" = "yes"; then
628 AC_MSG_WARN([GPGCONF must be at least version $NEED_GPGCONF_VERSION])
631 run_gpgconf_test="$ok"
632 AC_ARG_ENABLE(gpgconf-test,
633 AC_HELP_STRING([--disable-gpgconf-test], [disable GPGCONF run test]),
634 run_gpgconf_test=$enableval)
635 AM_CONDITIONAL(RUN_GPGCONF_TESTS, test "$run_gpgconf_test" = "yes")
640 AC_HELP_STRING([--with-g13=PATH],
641 [use g13 binary at PATH]),
642 G13=$withval, NO_OVERRIDE=yes)
643 if test "$NO_OVERRIDE" = "yes" || test "$G13" = "yes"; then
646 if test "$cross_compiling" != "yes"; then
647 AC_PATH_PROG(G13, g13)
649 if test -z "$G13"; then
653 if test "$G13" = no; then
654 if test "$NO_OVERRIDE" = "yes"; then
655 if test "$cross_compiling" != "yes"; then
658 *** Could not find g13, install g13 or use --with-g13=PATH to enable it
663 *** Can not determine path to g13 when cross-compiling, use --with-g13=PATH
668 AC_DEFINE_UNQUOTED(G13_PATH, "$G13", [Path to the G13 binary.])
669 AC_DEFINE(ENABLE_G13,1,[Whether G13 support is enabled])
671 AM_CONDITIONAL(HAVE_G13, test "$G13" != "no")
673 dnl Check for G13 version requirement.
676 if test -z "$G13" -o "x$G13" = "xno"; then
679 if test "$cross_compiling" = "yes"; then
680 AC_MSG_WARN([G13 version can not be checked when cross compiling])
683 if test ! -x "$G13"; then
684 AC_MSG_WARN([G13 not executable, version check disabled])
689 if test "$ok" = "maybe"; then
690 AC_MSG_CHECKING(for G13 >= $NEED_G13_VERSION)
691 req_major=`echo $NEED_G13_VERSION | \
692 sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\1/'`
693 req_minor=`echo $NEED_G13_VERSION | \
694 sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\2/'`
695 req_micro=`echo $NEED_G13_VERSION | \
696 sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'`
697 G13_VERSION=`$G13 --version | sed -n '1 s/.*\ \([[0-9]].*\)/\1/p'`
698 major=`echo $G13_VERSION | \
699 sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'`
700 minor=`echo $G13_VERSION | \
701 sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\2/'`
702 micro=`echo $G13_VERSION | \
703 sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\3/'`
705 if test "$major" -gt "$req_major"; then
708 if test "$major" -eq "$req_major"; then
709 if test "$minor" -gt "$req_minor"; then
712 if test "$minor" -eq "$req_minor"; then
713 if test "$micro" -ge "$req_micro"; then
720 if test "$ok" = "yes"; then
724 AC_MSG_WARN([G13 must be at least version $NEED_G13_VERSION])
728 AC_ARG_ENABLE(g13-test,
729 AC_HELP_STRING([--disable-g13-test], [disable G13 run test]),
730 run_g13_test=$enableval)
731 AM_CONDITIONAL(RUN_G13_TESTS, test "$run_g13_test" = "yes")
735 AC_CHECK_FUNCS(funopen)
736 if test $ac_cv_func_funopen != yes; then
737 # No funopen but we can implement that in terms of fopencookie.
738 AC_CHECK_FUNCS(fopencookie)
739 if test $ac_cv_func_fopencookie = yes; then
740 AC_REPLACE_FUNCS(funopen)
744 *** No implementation of fopencookie or funopen available
749 # Check for getgid etc
750 AC_CHECK_FUNCS(getgid getegid)
753 # Replacement functions.
754 AC_REPLACE_FUNCS(stpcpy)
755 # Check for unistd.h for setenv replacement function.
756 AC_CHECK_HEADERS(unistd.h)
757 AC_REPLACE_FUNCS(setenv)
759 # Assuan check for descriptor passing.
760 AC_CHECK_MEMBER(struct cmsghdr.cmsg_len,
761 [supports_descriptor_passing=yes],
762 [supports_descriptor_passing=no
765 *** Data structure for sending ancillary data missing.
766 *** Descriptor passing won't work.
771 #include <sys/types.h>
772 #include <sys/socket.h>
780 AC_ARG_ENABLE(fd-passing,
781 AC_HELP_STRING([--enable-fd-passing], [use FD passing if supported]),
782 use_descriptor_passing=$enableval)
784 if test "$supports_descriptor_passing" != "yes"; then
785 use_descriptor_passing=no
788 if test "$use_descriptor_passing" = "yes"; then
789 AC_DEFINE(USE_DESCRIPTOR_PASSING,1,
790 [Defined if descriptor passing is enabled and supported])
793 AM_CONDITIONAL(USE_DESCRIPTOR_PASSING, test "$use_descriptor_passing" = "yes")
797 if test "$use_descriptor_passing" = "yes" && test "$have_libassuan" = "yes"; then
800 if test "$uiserver" != "no"; then
801 AC_DEFINE(ENABLE_UISERVER, 1,
802 [Defined if we are building with uiserver support.])
804 AM_CONDITIONAL(HAVE_UISERVER, test "$uiserver" != "no")
807 AM_CONDITIONAL(BUILD_COMPLUS, test "$component_system" = "COM+")
809 # Generate values for the DLL version info
810 if test "$have_w32_system" = yes; then
811 BUILD_TIMESTAMP=`date --iso-8601=minutes`
813 BUILD_FILEVERSION=`echo "$VERSION" | sed 's/\([0-9.]*\).*/\1./;s/\./,/g'`
815 BUILD_FILEVERSION="${BUILD_FILEVERSION}${BUILD_REVISION}"
817 AC_SUBST(BUILD_REVISION)
818 AC_SUBST(BUILD_TIMESTAMP)
819 AC_SUBST(BUILD_FILEVERSION)
821 # Add a few constants to help porting to W32
822 AH_VERBATIM([SEPCONSTANTS],
824 /* Separators as used in $PATH. */
825 #ifdef HAVE_DOSISH_SYSTEM
826 #define PATHSEP_C ';'
828 #define PATHSEP_C ':'
833 /* Definition of GCC specific attributes. */
835 # define GPGME_GCC_A_PURE __attribute__ ((__pure__))
837 # define GPGME_GCC_A_PURE
842 # Substitution used for gpgme-config
843 GPGME_CONFIG_LIBS="-lgpgme"
844 GPGME_CONFIG_CFLAGS=""
845 AC_SUBST(GPGME_CONFIG_API_VERSION)
846 AC_SUBST(GPGME_CONFIG_LIBS)
847 AC_SUBST(GPGME_CONFIG_CFLAGS)
850 LTLIBOBJS=`echo "$LIB@&t@OBJS" |
851 sed 's,\.[[^.]]* ,.lo ,g;s,\.[[^.]]*$,.lo,'`
854 # Some checks for gpgme-tool
855 AC_CHECK_HEADER([argp.h])
856 AC_CHECK_TYPES([error_t], [],
857 [AC_DEFINE([error_t], [int],
858 [Define to a type to use for `error_t' if it is not otherwise available.])],
859 [#include <errno.h>])
864 if test "$require_libassuan" = "no"; then
868 *** You need libassuan to build this program with GPGSM support.
869 *** This library is for example available at
870 *** ftp://ftp.gnupg.org/pub/gcrypt/alpha/libassuan/
871 *** (at least version $NEED_LIBASSUAN_VERSION is required).
875 if test "$die" = "yes"; then
878 *** Required libraries not found. Please consult the above messages
879 *** and install them before running configure again.
885 # Create config files
887 AC_CONFIG_FILES(Makefile src/Makefile
891 tests/opassuan/Makefile
892 doc/Makefile complus/Makefile
895 AC_CONFIG_FILES(src/gpgme-config, chmod +x src/gpgme-config)
896 AC_CONFIG_FILES([lang/Makefile lang/cl/Makefile lang/cl/gpgme.asd])
900 GPGME v${VERSION} has been configured as follows:
903 GnuPG version: $GPG_VERSION, min. $NEED_GPG_VERSION
906 GpgSM version: $GPGSM_VERSION, min. $NEED_GPGSM_VERSION
908 GpgConf path: $GPGCONF
909 GpgConf version: $GPGCONF_VERSION, min. $NEED_GPGCONF_VERSION
912 G13 version: $G13_VERSION, min. $NEED_G13_VERSION
914 Assuan version: $LIBASSUAN_VERSION
917 FD Passing: $use_descriptor_passing
919 GPGME Pthread: $have_pthread