1 # configure.ac for GPGME
2 # Copyright (C) 2000 Werner Koch (dd9jn)
3 # Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
4 # 2009, 2010, 2011, 2012, 2013, 2014, 2015 g10 Code GmbH
6 # This file is part of GPGME.
8 # GPGME is free software; you can redistribute it and/or modify it
9 # under the terms of the GNU Lesser General Public License as
10 # published by the Free Software Foundation; either version 2.1 of the
11 # License, or (at your option) any later version.
13 # GPGME is distributed in the hope that it will be useful, but WITHOUT
14 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
15 # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
16 # Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with this program; if not, see <https://www.gnu.org/licenses/>.
21 # (Process this file with autoconf to produce a configure script.)
23 min_automake_version="1.14"
25 # To build a release you need to create a tag with the version number
26 # (git tag -s gpgme-n.m.k) and run "./autogen.sh --force". Please
27 # bump the version number immediately after the release and do another
28 # commit and push so that the git magic is able to work. See below
29 # for the LT versions.
30 m4_define(mym4_version_major, [1])
31 m4_define(mym4_version_minor, [11])
32 m4_define(mym4_version_micro, [0])
34 # Below is m4 magic to extract and compute the revision number, the
35 # decimalized short revision number, a beta version string, and a flag
36 # indicating a development version (mym4_isgit). Note that the m4
37 # processing is done by autoconf and not during the configure run.
38 m4_define(mym4_version,
39 [mym4_version_major.mym4_version_minor.mym4_version_micro])
40 m4_define([mym4_revision],
41 m4_esyscmd([git rev-parse --short HEAD | tr -d '\n\r']))
42 m4_define([mym4_revision_dec],
43 m4_esyscmd_s([echo $((0x$(echo ]mym4_revision[|head -c 4)))]))
44 m4_define([mym4_betastring],
45 m4_esyscmd_s([git describe --match 'gpgme-[0-9].*[0-9]' --long|\
46 awk -F- '$3!=0{print"-beta"$3}']))
47 m4_define([mym4_isgit],m4_if(mym4_betastring,[],[no],[yes]))
48 m4_define([mym4_full_version],[mym4_version[]mym4_betastring])
50 AC_INIT([gpgme],[mym4_full_version],[http://bugs.gnupg.org])
52 # LT Version numbers, remember to change them just *before* a release.
53 # (Code changed: REVISION++)
54 # (Interfaces added/removed/changed: CURRENT++, REVISION=0)
55 # (Interfaces added: AGE++)
56 # (Interfaces removed/changed: AGE=0)
58 LIBGPGME_LT_CURRENT=31
60 LIBGPGME_LT_REVISION=0
62 # If there is an ABI break in gpgmepp or qgpgme also bump the
63 # version in IMPORTED_LOCATION in the GpgmeppConfig-w32.cmake.in.in
65 LIBGPGMEPP_LT_CURRENT=12
67 LIBGPGMEPP_LT_REVISION=0
69 LIBQGPGME_LT_CURRENT=10
71 LIBQGPGME_LT_REVISION=1
73 # If the API is changed in an incompatible way: increment the next counter.
74 GPGME_CONFIG_API_VERSION=1
75 ##############################################
77 NEED_GPG_ERROR_VERSION=1.24
79 NEED_LIBASSUAN_VERSION=2.4.2
83 VERSION=$PACKAGE_VERSION
85 VERSION_MAJOR=mym4_version_major
86 VERSION_MINOR=mym4_version_minor
87 VERSION_MICRO=mym4_version_micro
89 AC_CONFIG_AUX_DIR([build-aux])
90 AC_CONFIG_MACRO_DIR([m4])
91 AC_CONFIG_SRCDIR(src/gpgme.h.in)
92 AC_CONFIG_HEADER(config.h)
93 AM_INIT_AUTOMAKE([serial-tests dist-bzip2 no-dist-gzip])
97 AC_ARG_VAR(SYSROOT,[locate config scripts also below that directory])
99 # Enable GNU extensions on systems that have them.
102 AH_VERBATIM([_REENTRANT],
103 [/* To allow the use of GPGME in multithreaded programs we have to use
104 special features from the library.
105 IMPORTANT: gpgme is not yet fully reentrant and you should use it
106 only from one thread. */
108 # define _REENTRANT 1
115 # Note: A suitable gitlog-to-changelog script can be found in GnuPG master.
116 AC_CHECK_PROGS(GITLOG_TO_CHANGELOG, gitlog-to-changelog, [gitlog-to-changelog])
118 AC_SUBST(LIBGPGME_LT_CURRENT)
119 AC_SUBST(LIBGPGME_LT_AGE)
120 AC_SUBST(LIBGPGME_LT_REVISION)
121 AC_SUBST(LIBGPGMEPP_LT_CURRENT)
122 AC_SUBST(LIBGPGMEPP_LT_AGE)
123 AC_SUBST(LIBGPGMEPP_LT_REVISION)
124 AC_SUBST(LIBQGPGME_LT_CURRENT)
125 AC_SUBST(LIBQGPGME_LT_AGE)
126 AC_SUBST(LIBQGPGME_LT_REVISION)
130 AC_SUBST(VERSION_MAJOR)
131 AC_SUBST(VERSION_MINOR)
132 AC_SUBST(VERSION_MICRO)
133 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of this package])
134 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version of this package])
135 VERSION_NUMBER=m4_esyscmd(printf "0x%02x%02x%02x" mym4_version_major \
136 mym4_version_minor mym4_version_micro)
137 AC_SUBST(VERSION_NUMBER)
139 # We need to compile and run a program on the build machine. A
140 # comment in libgpg-error says that the AC_PROG_CC_FOR_BUILD macro in
141 # the AC archive is broken for autoconf 2.57. Given that there is no
142 # newer version of that macro, we assume that it is also broken for
143 # autoconf 2.61 and thus we use a simple but usually sufficient
145 AC_MSG_CHECKING(for cc for build)
146 if test "$cross_compiling" = "yes"; then
147 CC_FOR_BUILD="${CC_FOR_BUILD-cc}"
149 CC_FOR_BUILD="${CC_FOR_BUILD-$CC}"
151 AC_MSG_RESULT($CC_FOR_BUILD)
152 AC_ARG_VAR(CC_FOR_BUILD,[build system C compiler])
155 # Don't default to build static libs.
157 LT_INIT([win32-dll disable-static])
158 LT_LANG([Windows Resource])
160 # For now we hardcode the use of version scripts. It would be better
161 # to write a test for this or even implement this within libtool.
162 have_ld_version_script=no
165 have_ld_version_script=yes
168 have_ld_version_script=yes
171 AC_DEFINE(_DARWIN_C_SOURCE, 900000L,
172 Expose all libc features (__DARWIN_C_FULL).)
173 AC_DEFINE(_XOPEN_SOURCE, 500, Activate POSIX interface on MacOS X)
177 AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, test "$have_ld_version_script" = "yes")
183 component_system=None
184 have_dosish_system=no
185 have_android_system=no
191 available_languages="cl cpp python python2 python3 qt"
192 default_languages="cl cpp python qt"
198 have_w32ce_system=yes
201 have_android_system=yes
204 have_macos_system=yes
208 *-mingw32ce*|*-mingw32*)
209 have_dosish_system=yes
211 GPG_DEFAULT='c:\\gnupg\\gpg.exe'
212 GPGSM_DEFAULT='c:\\gnupg\\gpgsm.exe'
213 GPGCONF_DEFAULT='c:\\gnupg\\gpgconf.exe'
214 G13_DEFAULT='c:\\gnupg\\g13.exe'
215 #component_system='COM+'
218 AC_ARG_ENABLE(w32-glib,
219 AC_HELP_STRING([--enable-w32-glib], [build GPGME Glib for W32]),
220 build_w32_glib=$enableval)
224 # XXX: Probably use exec-prefix here?
225 # GPG_DEFAULT='/usr/bin/gpg'
226 # GPGSM_DEFAULT='/usr/bin/gpgsm'
227 # GPGCONF_DEFAULT='/usr/bin/gpgconf'
228 # G13_DEFAULT='/usr/bin/g13'
232 if test "$have_dosish_system" = yes; then
233 AC_DEFINE(HAVE_DOSISH_SYSTEM,1,
234 [Defined if we run on some of the PCDOS like systems
235 (DOS, Windoze. OS/2) with special properties like
238 AM_CONDITIONAL(HAVE_DOSISH_SYSTEM, test "$have_dosish_system" = yes)
240 if test "$have_w32_system" = yes; then
241 AC_DEFINE(HAVE_W32_SYSTEM,1,
242 [Defined if we run on any kind of W32 API based system])
244 AM_CONDITIONAL(HAVE_W32_SYSTEM, test "$have_w32_system" = yes)
246 if test "$have_w64_system" = yes; then
247 AC_DEFINE(HAVE_W64_SYSTEM,1,
248 [Defined if we run on a 64 bit W32 API based system])
250 AM_CONDITIONAL(HAVE_W64_SYSTEM, test "$have_w64_system" = yes)
252 if test "$have_w32ce_system" = yes; then
253 AC_DEFINE(HAVE_W32CE_SYSTEM,1,
254 [Defined if we run on a W32 CE API based system])
256 AM_CONDITIONAL(HAVE_W32CE_SYSTEM, test "$have_w32ce_system" = yes)
258 if test "$have_android_system" = yes; then
259 AC_DEFINE(HAVE_ANDROID_SYSTEM,1, [Defined if we build for an Android system])
261 AM_CONDITIONAL(HAVE_ANDROID_SYSTEM, test "$have_android_system" = yes)
263 if test "$have_macos_system" = yes; then
264 AC_DEFINE(HAVE_MACOS_SYSTEM,1,
265 [Defined if we build for an MacOS system])
267 AM_CONDITIONAL(HAVE_MACOS_SYSTEM, test "$have_macos_system" = yes)
269 AM_CONDITIONAL(BUILD_W32_GLIB, test "$build_w32_glib" = yes)
272 AC_ARG_ENABLE([fixed-path],
273 AC_HELP_STRING([--enable-fixed-path=PATH],
274 [locate binaries only via this PATH]),
275 [fixed_search_path="$enableval"],
276 [fixed_search_path=""])
277 if test x$fixed_search_path != x ; then
278 AC_DEFINE_UNQUOTED(FIXED_SEARCH_PATH, "$fixed_search_path",
279 [Locate binaries only via this PATH])
283 # Note: You need to declare all possible languages also in
284 # lang/Makefile.am's DIST_SUBDIRS.
285 AC_ARG_ENABLE([languages],
286 AC_HELP_STRING([--enable-languages=languages],
287 [enable only specific language bindings]),
288 [enabled_languages=`echo $enableval | \
289 tr ',:' ' ' | tr '[A-Z]' '[a-z]' | \
291 [enabled_languages="maybe"])
292 if test "x$enabled_languages" = "x" \
293 -o "$enabled_languages" = "no"; then
297 # If languages are explicitly set missing requirements
298 # for the languages are treated as errors otherwise
299 # there will be a warning.
301 if test "x$enabled_languages" = "xmaybe"; then
303 enabled_languages="$default_languages"
306 for language in $enabled_languages; do
307 LIST_MEMBER($language, $available_languages)
308 if test "$found" = "0"; then
309 AC_MSG_ERROR([unsupported language binding specified])
315 # Enable C++ 11 if cpp language is requested
316 LIST_MEMBER("cpp", $enabled_languages)
317 if test "$found" = "1"; then
318 AX_CXX_COMPILE_STDCXX(11, noext, optional)
319 if test "$HAVE_CXX11" != "1"; then
320 if test "$explicit_languages" = "1"; then
323 *** A compiler with c++11 support is required for the c++ binding.
326 enabled_languages=$(echo $enabled_languages | sed 's/cpp//')
327 enabled_languages=$(echo $enabled_languages | sed 's/qt//')
330 *** No c++11 support detected. C++ and Qt bindings will be disabled.
336 # Check that if qt is enabled cpp also is enabled
337 LIST_MEMBER("qt", $enabled_languages)
338 if test "$found" = "1"; then
339 # We need to ensure that in the language order qt comes after cpp
340 # so we remove qt first and explicitly add it as last list member.
341 enabled_languages=$(echo $enabled_languages | sed 's/qt//')
342 LIST_MEMBER("cpp", $enabled_languages)
343 if test "$found" = "0"; then
346 *** Qt language binding depends on cpp binding.
350 if test "$have_qt5_libs" != "yes"; then
351 if test "$explicit_languages" = "1"; then
354 *** Qt5 (Qt5Core) is required for Qt binding.
359 *** Qt5 (Qt5Core) not found Qt Binding will be disabled.
363 enabled_languages=`echo $enabled_languages qt`
365 AC_CHECK_PROGS([DOXYGEN], [doxygen])
366 if test -z "$DOXYGEN";
367 # This is not highlighted becase it's not really important.
368 then AC_MSG_WARN([Doxygen not found - Qt binding doc will not be built.])
370 AC_CHECK_PROGS([GRAPHVIZ], [dot])
371 if test -z "$GRAPHVIZ";
372 then AC_MSG_WARN([Graphviz not found - Qt binding doc will not have diagrams.])
376 AM_CONDITIONAL([HAVE_DOXYGEN],
377 [test -n "$DOXYGEN"])
378 if test -n "$GRAPHVIZ"; then
386 LIST_MEMBER("python2", $enabled_languages)
388 LIST_MEMBER("python3", $enabled_languages)
390 LIST_MEMBER("python", $enabled_languages)
392 if test "$found_py" = "1" -o "$found_py2" = "1" -o "$found_py3" = "1"; then
394 if test -z "$SWIG"; then
395 if test "$explicit_languages" = "1"; then
398 *** You need SWIG to build the Python bindings.
401 enabled_languages=$(echo $enabled_languages | sed 's/python//')
404 # Reset all the stuff, just to be sure.
409 unset PYTHON_CPPFLAGS
411 unset PYTHON_SITE_PKG
412 unset PYTHON_EXTRA_LIBS
413 unset PYTHON_EXTRA_LDFLAGS
414 unset ac_cv_path_PYTHON
415 unset am_cv_pathless_PYTHON
416 unset am_cv_python_version
417 unset am_cv_python_platform
418 unset am_cv_python_pythondir
419 unset am_cv_python_pyexecdir
421 if test "$found_py" = "1" -o "$found_py2" = "1"; then
422 AM_PATH_PYTHON([2.7], [
424 if test "$PYTHON_VERSION"; then
425 PYTHONS="$(echo $PYTHONS $PYTHON)"
426 PYTHON_VERSIONS="$(echo $PYTHON_VERSIONS $PYTHON_VERSION)"
431 if test "$found_py" = "1" -o "$found_py3" = "1"; then
432 # Reset everything, so that we can look for another Python.
435 unset PYTHON_CPPFLAGS
437 unset PYTHON_SITE_PKG
438 unset PYTHON_EXTRA_LIBS
439 unset PYTHON_EXTRA_LDFLAGS
440 unset ac_cv_path_PYTHON
441 unset am_cv_pathless_PYTHON
442 unset am_cv_python_version
443 unset am_cv_python_platform
444 unset am_cv_python_pythondir
445 unset am_cv_python_pyexecdir
446 AM_PATH_PYTHON([3.4], [
448 if test "$PYTHON_VERSION"; then
449 PYTHONS="$(echo $PYTHONS $PYTHON)"
450 PYTHON_VERSIONS="$(echo $PYTHON_VERSIONS $PYTHON_VERSION)"
455 # Recover some values lost in the second attempt to find Python.
456 PYTHON="$(echo $PYTHONS | cut -d ' ' -f 1)"
457 PYTHON_VERSION="$(echo $PYTHON_VERSIONS | cut -d ' ' -f 1)"
460 PYTHONS="$(echo $PYTHONS | tr '[[:space:]]' '\n' | sort | uniq | tr '\n' ' ' | sed -e 's/ $//')"
461 PYTHON_VERSIONS="$(echo $PYTHON_VERSIONS | tr '[[:space:]]' '\n' | sort | uniq | tr '\n' ' ' | sed -e 's/ $//')"
463 if test "$PYTHON_VERSIONS"; then
464 enabled_languages_v=$(echo $enabled_languages | sed -Ee "s/python[[23]]?/python ($PYTHON_VERSIONS)/")
465 enabled_languages=$(echo $enabled_languages | sed -Ee "s/python[[23]]?/python/")
467 if test "$explicit_languages" = "1"; then
470 *** Please install the python development packages.
473 enabled_languages=$(echo $enabled_languages | sed 's/python//')
477 AC_SUBST(PYTHONS, $PYTHONS)
481 AC_SUBST(ENABLED_LANGUAGES, $enabled_languages)
484 # Provide information about the build.
486 BUILD_REVISION="mym4_revision"
487 AC_SUBST(BUILD_REVISION)
488 AC_DEFINE_UNQUOTED(BUILD_REVISION, "$BUILD_REVISION",
489 [GIT commit id revision used to build this package])
492 BUILD_FILEVERSION=`echo "$PACKAGE_VERSION"|sed 's/\([0-9.]*\).*/\1./;s/\./,/g'`
494 BUILD_FILEVERSION="${BUILD_FILEVERSION}mym4_revision_dec"
495 AC_SUBST(BUILD_FILEVERSION)
497 AC_ARG_ENABLE([build-timestamp],
498 AC_HELP_STRING([--enable-build-timestamp],
499 [set an explicit build timestamp for reproducibility.
500 (default is the current time in ISO-8601 format)]),
501 [if test "$enableval" = "yes"; then
502 BUILD_TIMESTAMP=`date -u +%Y-%m-%dT%H:%M+0000 2>/dev/null || date`
504 BUILD_TIMESTAMP="$enableval"
506 [BUILD_TIMESTAMP="<none>"])
507 AC_SUBST(BUILD_TIMESTAMP)
508 AC_DEFINE_UNQUOTED(BUILD_TIMESTAMP, "$BUILD_TIMESTAMP",
509 [The time this package was configured for a build])
513 # Options to disable some regression tests
515 run_gpgconf_test="yes"
516 AC_ARG_ENABLE(gpgconf-test,
517 AC_HELP_STRING([--disable-gpgconf-test], [disable GPGCONF regression test]),
518 run_gpgconf_test=$enableval)
519 AM_CONDITIONAL(RUN_GPGCONF_TESTS, test "$run_gpgconf_test" = "yes")
522 AC_ARG_ENABLE(gpg-test,
523 AC_HELP_STRING([--disable-gpg-test], [disable GPG regression test]),
524 run_gpg_test=$enableval)
525 AM_CONDITIONAL(RUN_GPG_TESTS, test "$run_gpg_test" = "yes")
528 AC_ARG_ENABLE(gpgsm-test,
529 AC_HELP_STRING([--disable-gpgsm-test], [disable GPGSM regression test]),
530 run_gpgsm_test=$enableval)
531 AM_CONDITIONAL(RUN_GPGSM_TESTS, test "$run_gpgsm_test" = "yes")
534 AC_ARG_ENABLE(g13-test,
535 AC_HELP_STRING([--disable-g13-test], [disable G13 regression test]),
536 run_g13_test=$enableval)
537 AM_CONDITIONAL(RUN_G13_TESTS, test "$run_g13_test" = "yes")
540 # Checks for header files.
541 AC_CHECK_HEADERS_ONCE([locale.h sys/select.h sys/uio.h argp.h
542 unistd.h sys/time.h sys/types.h sys/stat.h])
547 AC_CHECK_SIZEOF(unsigned int)
552 # A simple compile time check in gpgme.h for GNU/Linux systems that
553 # prevents a file offset bits mismatch between gpgme and the application.
554 NEED__FILE_OFFSET_BITS=0
555 if test "$have_w32_system" != yes; then
556 case "$ac_cv_sys_file_offset_bits" in
557 "" | no | unknown) ;;
559 NEED__FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits
563 AC_SUBST(NEED__FILE_OFFSET_BITS)
565 # Figure out platform dependent typedefs for gpgme.h
566 if test "$have_w32_system" = yes; then
567 INSERT__TYPEDEFS_FOR_GPGME_H="
570 typedef int64_t gpgme_off_t;
571 typedef int64_t gpgme_ssize_t;
573 typedef long gpgme_off_t;
574 typedef long gpgme_ssize_t;
576 API__OFF_T="gpgme_off_t"
577 API__SSIZE_T="gpgme_ssize_t"
579 INSERT__TYPEDEFS_FOR_GPGME_H="
580 #include <sys/types.h>
581 typedef off_t gpgme_off_t;
582 typedef ssize_t gpgme_ssize_t;"
584 API__SSIZE_T="ssize_t"
586 AC_SUBST(INSERT__TYPEDEFS_FOR_GPGME_H)
587 AM_SUBST_NOTMAKE(INSERT__TYPEDEFS_FOR_GPGME_H)
589 AM_SUBST_NOTMAKE(API__OFF_T)
590 AC_SUBST(API__SSIZE_T)
591 AM_SUBST_NOTMAKE(API__SSIZE_T)
593 # Checks for compiler features.
594 if test "$GCC" = yes; then
595 CFLAGS="$CFLAGS -Wall -Wcast-align -Wshadow -Wstrict-prototypes"
596 if test "$USE_MAINTAINER_MODE" = "yes"; then
597 CFLAGS="$CFLAGS -Wformat -Wno-format-y2k -Wformat-security"
599 # If -Wno-missing-field-initializers is supported we can enable a
600 # a bunch of really useful warnings.
601 AC_MSG_CHECKING([if gcc supports -Wno-missing-field-initializers])
602 _gcc_cflags_save=$CFLAGS
603 CFLAGS="-Wno-missing-field-initializers"
604 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],_gcc_wopt=yes,_gcc_wopt=no)
605 AC_MSG_RESULT($_gcc_wopt)
606 CFLAGS=$_gcc_cflags_save;
607 if test x"$_gcc_wopt" = xyes ; then
608 CFLAGS="$CFLAGS -W -Wextra -Wbad-function-cast"
609 CFLAGS="$CFLAGS -Wwrite-strings"
610 CFLAGS="$CFLAGS -Wdeclaration-after-statement"
611 CFLAGS="$CFLAGS -Wno-missing-field-initializers"
612 CFLAGS="$CFLAGS -Wno-sign-compare"
614 CXXFLAGS="$CXXFLAGS -Wall -Wextra -Wno-shadow"
616 AC_MSG_CHECKING([if gcc supports -Wpointer-arith])
617 _gcc_cflags_save=$CFLAGS
618 CFLAGS="-Wpointer-arith"
619 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],_gcc_wopt=yes,_gcc_wopt=no)
620 AC_MSG_RESULT($_gcc_wopt)
621 CFLAGS=$_gcc_cflags_save;
622 if test x"$_gcc_wopt" = xyes ; then
623 CFLAGS="$CFLAGS -Wpointer-arith"
626 if test "$have_w32_system" = yes; then
627 CFLAGS="$CFLAGS -mms-bitfields"
631 # Only used for debugging, so no serious test needed (for actual
632 # functionality you have to test libc as well, this only tests the
634 AC_CACHE_CHECK([for __thread],[gpgme_cv_tls_works],
635 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([__thread int foo;])],
636 gpgme_cv_tls_works=yes,gpgme_cv_tls_works=no))
637 if test "$gpgme_cv_tls_works" = yes; then
638 AC_DEFINE(HAVE_TLS, [1], [Define if __thread is supported])
642 # Checks for library functions.
643 AC_MSG_NOTICE([checking for libraries])
647 # Try to find a thread-safe version of ttyname().
648 gnupg_REPLACE_TTYNAME_R
649 if test "$ac_cv_func_ttyname_r" != yes; then
652 *** ttyname() is not thread-safe and ttyname_r() does not exist
656 # Try to find a thread-safe version of getenv().
657 have_thread_safe_getenv=no
659 if test $GLIBC21 = yes -o $have_w32_system = yes; then
660 have_thread_safe_getenv=yes
662 if test $have_thread_safe_getenv = yes; then
663 AC_DEFINE(HAVE_THREAD_SAFE_GETENV, [1], [Define if getenv() is thread-safe])
666 AC_CHECK_FUNCS(getenv_r, have_getenv_r=yes)
667 if test $have_getenv_r = no && test $have_thread_safe_getenv = no; then
670 *** getenv() is not thread-safe and getenv_r() does not exist
674 # For converting time strings to seconds since Epoch, we need the timegm
676 AC_CHECK_FUNCS(timegm)
677 if test "$ac_cv_func_timegm" != yes; then
680 *** timegm() not available - a non-thread-safe kludge will be used
681 *** and the TZ variable might be changed at runtime.
685 AC_CHECK_FUNCS(setlocale)
687 # Checking for libgpg-error.
689 AM_PATH_GPG_ERROR("$NEED_GPG_ERROR_VERSION",
690 have_gpg_error=yes, have_gpg_error=no)
691 AC_DEFINE(GPG_ERR_SOURCE_DEFAULT, GPG_ERR_SOURCE_GPGME,
692 [The default error source for GPGME.])
696 AM_PATH_LIBASSUAN("$NEED_LIBASSUAN_API:$NEED_LIBASSUAN_VERSION",
697 have_libassuan=yes, have_libassuan=no)
698 if test "$have_libassuan" = "yes"; then
699 AC_DEFINE_UNQUOTED(GPGME_LIBASSUAN_VERSION, "$libassuan_version",
700 [version of the libassuan library])
708 # Check for getgid etc
709 AC_CHECK_FUNCS(getgid getegid closefrom)
712 # Replacement functions.
713 AC_REPLACE_FUNCS(stpcpy)
714 AC_REPLACE_FUNCS(setenv)
716 # Assuan check for descriptor passing.
717 AC_CHECK_MEMBER(struct cmsghdr.cmsg_len,
718 [supports_descriptor_passing=yes],
719 [supports_descriptor_passing=no
722 *** Data structure for sending ancillary data missing.
723 *** Descriptor passing won't work.
728 #include <sys/types.h>
729 #include <sys/socket.h>
737 use_descriptor_passing=yes
738 AC_ARG_ENABLE(fd-passing,
739 AC_HELP_STRING([--disable-fd-passing], [do not use FD passing]),
740 use_descriptor_passing=$enableval)
742 if test "$supports_descriptor_passing" != "yes"; then
743 use_descriptor_passing=no
746 if test "$use_descriptor_passing" = "yes"; then
747 AC_DEFINE(USE_DESCRIPTOR_PASSING,1,
748 [Defined if descriptor passing is enabled and supported])
751 AM_CONDITIONAL(USE_DESCRIPTOR_PASSING, test "$use_descriptor_passing" = "yes")
755 if test "$use_descriptor_passing" = "yes" && test "$have_libassuan" = "yes"; then
758 if test "$uiserver" != "no"; then
759 AC_DEFINE(ENABLE_UISERVER, 1,
760 [Defined if we are building with uiserver support.])
762 AM_CONDITIONAL(HAVE_UISERVER, test "$uiserver" != "no")
765 # Option --disable-linux-getdents
767 # By default we use SYS_getdents on Linux to optimize fd closing
768 # before an exec. This option allows to switch this optimization off.
769 use_linux_getdents=yes
770 AC_ARG_ENABLE(linux-getdents,
771 AC_HELP_STRING([--disable-linux-getdents],
772 [do not use SYS_getdents on Linux]),
773 use_linux_getdents=$enableval)
774 if test "$use_linux_getdents" = "yes"; then
777 AC_DEFINE(USE_LINUX_GETDENTS,1,
778 [Defined if SYS_getdents can be used on Linux])
785 # Add a few constants to help porting to W32
787 AH_VERBATIM([SEPCONSTANTS],
789 /* Separators as used in $PATH and file name. */
790 #ifdef HAVE_DOSISH_SYSTEM
791 #define PATHSEP_C ';'
792 #define DIRSEP_C '\\'
793 #define DIRSEP_S "\\"
795 #define PATHSEP_C ':'
802 /* Definition of GCC specific attributes. */
804 # define GPGME_GCC_A_PURE __attribute__ ((__pure__))
806 # define GPGME_GCC_A_PURE
809 /* Under WindowsCE we need gpg-error's strerror macro. */
810 #define GPG_ERR_ENABLE_ERRNO_MACROS 1
812 #define CRIGHTBLURB "Copyright (C) 2000 Werner Koch\n" \
813 "Copyright (C) 2001--2018 g10 Code GmbH\n"
817 # Substitution used for gpgme-config
818 GPGME_CONFIG_LIBS="-lgpgme"
819 GPGME_CONFIG_CFLAGS=""
820 GPGME_CONFIG_HOST="$host"
821 GPGME_CONFIG_AVAIL_LANG="$enabled_languages"
822 AC_SUBST(GPGME_CONFIG_API_VERSION)
823 AC_SUBST(GPGME_CONFIG_LIBS)
824 AC_SUBST(GPGME_CONFIG_CFLAGS)
825 AC_SUBST(GPGME_CONFIG_HOST)
826 AC_SUBST(GPGME_CONFIG_AVAIL_LANG)
829 LTLIBOBJS=`echo "$LIB@&t@OBJS" |
830 sed 's,\.[[^.]]* ,.lo ,g;s,\.[[^.]]*$,.lo,'`
833 # Some checks for gpgme-tool
834 # Done at top: AC_CHECK_HEADER([argp.h])
835 AC_CHECK_TYPES([error_t], [],
836 [AC_DEFINE([error_t], [int],
837 [Define to a type to use for `error_t' if it is not otherwise available.])],
838 [#include <errno.h>])
841 # A substitution to set generated files in a Emacs buffer to read-only.
842 AC_SUBST(emacs_local_vars_begin, [['Local][ ][Variables:']])
843 AC_SUBST(emacs_local_vars_read_only, ['buffer-read-only: t'])
844 AC_SUBST(emacs_local_vars_end, ['End:'])
848 if test "$have_gpg_error" = "no"; then
852 *** You need libgpg-error to build this program.
853 ** This library is for example available at
854 *** ftp://ftp.gnupg.org/gcrypt/libgpg-error
855 *** (at least version $NEED_GPG_ERROR_VERSION is required.)
858 if test "$have_libassuan" = "no"; then
862 *** You need libassuan to build this program.
863 *** This library is for example available at
864 *** ftp://ftp.gnupg.org/gcrypt/libassuan/
865 *** (at least version $NEED_LIBASSUAN_VERSION (API $NEED_LIBASSUAN_API) is required).
869 if test "$die" = "yes"; then
872 *** Required libraries not found. Please consult the above messages
873 *** and install them before running configure again.
879 # Create config files
881 AC_CONFIG_FILES(Makefile src/Makefile
885 tests/opassuan/Makefile
889 AC_CONFIG_FILES(src/gpgme-config, chmod +x src/gpgme-config)
890 AC_CONFIG_FILES(lang/cpp/Makefile lang/cpp/src/Makefile)
891 AC_CONFIG_FILES(lang/cpp/src/GpgmeppConfig-w32.cmake.in)
892 AC_CONFIG_FILES(lang/cpp/src/GpgmeppConfig.cmake.in)
893 AC_CONFIG_FILES(lang/cpp/src/GpgmeppConfigVersion.cmake)
894 AC_CONFIG_FILES(lang/cpp/src/gpgmepp_version.h)
895 AC_CONFIG_FILES(lang/qt/Makefile lang/qt/src/Makefile)
896 AC_CONFIG_FILES(lang/qt/src/QGpgmeConfig-w32.cmake.in)
897 AC_CONFIG_FILES(lang/qt/src/QGpgmeConfig.cmake.in)
898 AC_CONFIG_FILES(lang/qt/src/QGpgmeConfigVersion.cmake)
899 AC_CONFIG_FILES(lang/qt/tests/Makefile)
900 AC_CONFIG_FILES(lang/qt/src/qgpgme_version.h)
901 AC_CONFIG_FILES([lang/Makefile lang/cl/Makefile lang/cl/gpgme.asd])
902 AM_COND_IF([HAVE_DOXYGEN], [AC_CONFIG_FILES([lang/qt/doc/Doxyfile])])
903 AC_CONFIG_FILES(lang/qt/doc/Makefile)
904 AC_CONFIG_FILES([lang/python/Makefile
905 lang/python/version.py
906 lang/python/tests/Makefile])
907 AC_CONFIG_FILES([lang/python/setup.py], [chmod a+x lang/python/setup.py])
911 GPGME v${VERSION} has been configured as follows:
913 Revision: mym4_revision (mym4_revision_dec)
917 FD Passing: $use_descriptor_passing
919 Language bindings: ${enabled_languages_v:-$enabled_languages}
921 if test "x${gpg_config_script_warn}" != x; then
923 Mismatches between the target platform and the to
924 be used libraries have been been detected for:
925 ${gpg_config_script_warn}
926 Please check above for warning messages.