1 # configure.ac for GPGME
2 # Copyright (C) 2000 Werner Koch (dd9jn)
3 # Copyright (C) 2001-2018 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 General Public License
18 # along with this program; if not, see <https://www.gnu.org/licenses/>.
20 # (Process this file with autoconf to produce a configure script.)
22 min_automake_version="1.14"
24 # To build a release you need to create a tag with the version number
25 # (git tag -s gpgme-n.m.k) and run "./autogen.sh --force". Please
26 # bump the version number immediately after the release and do another
27 # commit and push so that the git magic is able to work. See below
28 # for the LT versions.
29 m4_define(mym4_version_major, [1])
30 m4_define(mym4_version_minor, [12])
31 m4_define(mym4_version_micro, [0])
33 # Below is m4 magic to extract and compute the revision number, the
34 # decimalized short revision number, a beta version string, and a flag
35 # indicating a development version (mym4_isgit). Note that the m4
36 # processing is done by autoconf and not during the configure run.
37 m4_define(mym4_version,
38 [mym4_version_major.mym4_version_minor.mym4_version_micro])
39 m4_define([mym4_revision],
40 m4_esyscmd([git rev-parse --short HEAD | tr -d '\n\r']))
41 m4_define([mym4_revision_dec],
42 m4_esyscmd_s([echo $((0x$(echo ]mym4_revision[|head -c 4)))]))
43 m4_define([mym4_betastring],
44 m4_esyscmd_s([git describe --match 'gpgme-[0-9].*[0-9]' --long|\
45 awk -F- '$3!=0{print"-beta"$3}']))
46 m4_define([mym4_isgit],m4_if(mym4_betastring,[],[no],[yes]))
47 m4_define([mym4_full_version],[mym4_version[]mym4_betastring])
49 AC_INIT([gpgme],[mym4_full_version],[http://bugs.gnupg.org])
51 # LT Version numbers, remember to change them just *before* a release.
52 # (Code changed: REVISION++)
53 # (Interfaces added/removed/changed: CURRENT++, REVISION=0)
54 # (Interfaces added: AGE++)
55 # (Interfaces removed/changed: AGE=0)
57 LIBGPGME_LT_CURRENT=32
59 LIBGPGME_LT_REVISION=0
61 # If there is an ABI break in gpgmepp or qgpgme also bump the
62 # version in IMPORTED_LOCATION in the GpgmeppConfig-w32.cmake.in.in
64 LIBGPGMEPP_LT_CURRENT=14
66 LIBGPGMEPP_LT_REVISION=0
68 LIBQGPGME_LT_CURRENT=10
70 LIBQGPGME_LT_REVISION=2
72 # If the API is changed in an incompatible way: increment the next counter.
73 GPGME_CONFIG_API_VERSION=1
74 ##############################################
76 NEED_GPG_ERROR_VERSION=1.24
78 NEED_LIBASSUAN_VERSION=2.4.2
82 VERSION=$PACKAGE_VERSION
84 VERSION_MAJOR=mym4_version_major
85 VERSION_MINOR=mym4_version_minor
86 VERSION_MICRO=mym4_version_micro
88 AC_CONFIG_AUX_DIR([build-aux])
89 AC_CONFIG_MACRO_DIR([m4])
90 AC_CONFIG_SRCDIR(src/gpgme.h.in)
91 AC_CONFIG_HEADER(conf/config.h)
92 AM_INIT_AUTOMAKE([serial-tests dist-bzip2 no-dist-gzip])
96 AC_ARG_VAR(SYSROOT,[locate config scripts also below that directory])
98 # Enable GNU extensions on systems that have them.
101 AH_VERBATIM([_REENTRANT],
102 [/* To allow the use of GPGME in multithreaded programs we have to use
103 special features from the library.
104 IMPORTANT: gpgme is not yet fully reentrant and you should use it
105 only from one thread. */
107 # define _REENTRANT 1
114 # Note: A suitable gitlog-to-changelog script can be found in GnuPG master.
115 AC_CHECK_PROGS(GITLOG_TO_CHANGELOG, gitlog-to-changelog, [gitlog-to-changelog])
117 AC_SUBST(LIBGPGME_LT_CURRENT)
118 AC_SUBST(LIBGPGME_LT_AGE)
119 AC_SUBST(LIBGPGME_LT_REVISION)
120 AC_SUBST(LIBGPGMEPP_LT_CURRENT)
121 AC_SUBST(LIBGPGMEPP_LT_AGE)
122 AC_SUBST(LIBGPGMEPP_LT_REVISION)
123 AC_SUBST(LIBQGPGME_LT_CURRENT)
124 AC_SUBST(LIBQGPGME_LT_AGE)
125 AC_SUBST(LIBQGPGME_LT_REVISION)
129 AC_SUBST(VERSION_MAJOR)
130 AC_SUBST(VERSION_MINOR)
131 AC_SUBST(VERSION_MICRO)
132 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of this package])
133 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version of this package])
134 VERSION_NUMBER=m4_esyscmd(printf "0x%02x%02x%02x" mym4_version_major \
135 mym4_version_minor mym4_version_micro)
136 AC_SUBST(VERSION_NUMBER)
138 # We need to compile and run a program on the build machine. A
139 # comment in libgpg-error says that the AC_PROG_CC_FOR_BUILD macro in
140 # the AC archive is broken for autoconf 2.57. Given that there is no
141 # newer version of that macro, we assume that it is also broken for
142 # autoconf 2.61 and thus we use a simple but usually sufficient
144 AC_MSG_CHECKING(for cc for build)
145 if test "$cross_compiling" = "yes"; then
146 CC_FOR_BUILD="${CC_FOR_BUILD-cc}"
148 CC_FOR_BUILD="${CC_FOR_BUILD-$CC}"
150 AC_MSG_RESULT($CC_FOR_BUILD)
151 AC_ARG_VAR(CC_FOR_BUILD,[build system C compiler])
154 # Don't default to build static libs.
156 LT_INIT([win32-dll disable-static])
157 LT_LANG([Windows Resource])
159 # For now we hardcode the use of version scripts. It would be better
160 # to write a test for this or even implement this within libtool.
161 have_ld_version_script=no
164 have_ld_version_script=yes
167 have_ld_version_script=yes
170 AC_DEFINE(_DARWIN_C_SOURCE, 900000L,
171 Expose all libc features (__DARWIN_C_FULL).)
172 AC_DEFINE(_XOPEN_SOURCE, 500, Activate POSIX interface on MacOS X)
176 AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, test "$have_ld_version_script" = "yes")
182 component_system=None
183 have_dosish_system=no
184 have_android_system=no
190 available_languages="cl cpp python python2 python3 qt"
191 default_languages="cl cpp python qt"
197 have_w32ce_system=yes
200 have_android_system=yes
203 have_macos_system=yes
207 *-mingw32ce*|*-mingw32*)
208 have_dosish_system=yes
210 GPG_DEFAULT='c:\\gnupg\\gpg.exe'
211 GPGSM_DEFAULT='c:\\gnupg\\gpgsm.exe'
212 GPGCONF_DEFAULT='c:\\gnupg\\gpgconf.exe'
213 G13_DEFAULT='c:\\gnupg\\g13.exe'
214 #component_system='COM+'
217 AC_ARG_ENABLE(w32-glib,
218 AC_HELP_STRING([--enable-w32-glib], [build GPGME Glib for W32]),
219 build_w32_glib=$enableval)
223 # XXX: Probably use exec-prefix here?
224 # GPG_DEFAULT='/usr/bin/gpg'
225 # GPGSM_DEFAULT='/usr/bin/gpgsm'
226 # GPGCONF_DEFAULT='/usr/bin/gpgconf'
227 # G13_DEFAULT='/usr/bin/g13'
231 if test "$have_dosish_system" = yes; then
232 AC_DEFINE(HAVE_DOSISH_SYSTEM,1,
233 [Defined if we run on some of the PCDOS like systems
234 (DOS, Windoze. OS/2) with special properties like
237 AM_CONDITIONAL(HAVE_DOSISH_SYSTEM, test "$have_dosish_system" = yes)
239 if test "$have_w32_system" = yes; then
240 AC_DEFINE(HAVE_W32_SYSTEM,1,
241 [Defined if we run on any kind of W32 API based system])
243 AM_CONDITIONAL(HAVE_W32_SYSTEM, test "$have_w32_system" = yes)
245 if test "$have_w64_system" = yes; then
246 AC_DEFINE(HAVE_W64_SYSTEM,1,
247 [Defined if we run on a 64 bit W32 API based system])
249 AM_CONDITIONAL(HAVE_W64_SYSTEM, test "$have_w64_system" = yes)
251 if test "$have_w32ce_system" = yes; then
252 AC_DEFINE(HAVE_W32CE_SYSTEM,1,
253 [Defined if we run on a W32 CE API based system])
255 AM_CONDITIONAL(HAVE_W32CE_SYSTEM, test "$have_w32ce_system" = yes)
257 if test "$have_android_system" = yes; then
258 AC_DEFINE(HAVE_ANDROID_SYSTEM,1, [Defined if we build for an Android system])
260 AM_CONDITIONAL(HAVE_ANDROID_SYSTEM, test "$have_android_system" = yes)
262 if test "$have_macos_system" = yes; then
263 AC_DEFINE(HAVE_MACOS_SYSTEM,1,
264 [Defined if we build for an MacOS system])
266 AM_CONDITIONAL(HAVE_MACOS_SYSTEM, test "$have_macos_system" = yes)
268 AM_CONDITIONAL(BUILD_W32_GLIB, test "$build_w32_glib" = yes)
271 AC_ARG_ENABLE([fixed-path],
272 AC_HELP_STRING([--enable-fixed-path=PATH],
273 [locate binaries only via this PATH]),
274 [fixed_search_path="$enableval"],
275 [fixed_search_path=""])
276 if test x$fixed_search_path != x ; then
277 AC_DEFINE_UNQUOTED(FIXED_SEARCH_PATH, "$fixed_search_path",
278 [Locate binaries only via this PATH])
282 # Note: You need to declare all possible languages also in
283 # lang/Makefile.am's DIST_SUBDIRS.
284 AC_ARG_ENABLE([languages],
285 AC_HELP_STRING([--enable-languages=languages],
286 [enable only specific language bindings]),
287 [enabled_languages=`echo $enableval | \
288 tr ',:' ' ' | tr '[A-Z]' '[a-z]' | \
290 [enabled_languages="maybe"])
291 if test "x$enabled_languages" = "x" \
292 -o "$enabled_languages" = "no"; then
296 # If languages are explicitly set missing requirements
297 # for the languages are treated as errors otherwise
298 # there will be a warning.
300 if test "x$enabled_languages" = "xmaybe"; then
302 enabled_languages="$default_languages"
305 for language in $enabled_languages; do
306 LIST_MEMBER($language, $available_languages)
307 if test "$found" = "0"; then
308 AC_MSG_ERROR([unsupported language binding specified])
314 # Enable C++ 11 if cpp language is requested
315 LIST_MEMBER("cpp", $enabled_languages)
316 if test "$found" = "1"; then
317 AX_CXX_COMPILE_STDCXX(11, noext, optional)
318 if test "$HAVE_CXX11" != "1"; then
319 if test "$explicit_languages" = "1"; then
322 *** A compiler with c++11 support is required for the c++ binding.
325 enabled_languages=$(echo $enabled_languages | sed 's/cpp//')
326 enabled_languages=$(echo $enabled_languages | sed 's/qt//')
329 *** No c++11 support detected. C++ and Qt bindings will be disabled.
335 # Check that if qt is enabled cpp also is enabled
336 LIST_MEMBER("qt", $enabled_languages)
337 if test "$found" = "1"; then
338 # We need to ensure that in the language order qt comes after cpp
339 # so we remove qt first and explicitly add it as last list member.
340 enabled_languages=$(echo $enabled_languages | sed 's/qt//')
341 LIST_MEMBER("cpp", $enabled_languages)
342 if test "$found" = "0"; then
345 *** Qt language binding depends on cpp binding.
349 if test "$have_qt5_libs" != "yes"; then
350 if test "$explicit_languages" = "1"; then
353 *** Qt5 (Qt5Core) is required for Qt binding.
358 *** Qt5 (Qt5Core) not found Qt Binding will be disabled.
362 enabled_languages=`echo $enabled_languages qt`
364 AC_CHECK_PROGS([DOXYGEN], [doxygen])
365 if test -z "$DOXYGEN";
366 # This is not highlighted becase it's not really important.
367 then AC_MSG_WARN([Doxygen not found - Qt binding doc will not be built.])
369 AC_CHECK_PROGS([GRAPHVIZ], [dot])
370 if test -z "$GRAPHVIZ";
371 then AC_MSG_WARN([Graphviz not found - Qt binding doc will not have diagrams.])
375 AM_CONDITIONAL([HAVE_DOXYGEN],
376 [test -n "$DOXYGEN"])
377 if test -n "$GRAPHVIZ"; then
385 LIST_MEMBER("python2", $enabled_languages)
387 LIST_MEMBER("python3", $enabled_languages)
389 LIST_MEMBER("python", $enabled_languages)
391 if test "$found_py" = "1" -o "$found_py2" = "1" -o "$found_py3" = "1"; then
393 if test -z "$SWIG"; then
394 if test "$explicit_languages" = "1"; then
397 *** You need SWIG to build the Python bindings.
400 enabled_languages=$(echo $enabled_languages | sed 's/python//')
403 # Reset all the stuff, just to be sure.
408 unset PYTHON_CPPFLAGS
410 unset PYTHON_SITE_PKG
411 unset PYTHON_EXTRA_LIBS
412 unset PYTHON_EXTRA_LDFLAGS
413 unset ac_cv_path_PYTHON
414 unset am_cv_pathless_PYTHON
415 unset am_cv_python_version
416 unset am_cv_python_platform
417 unset am_cv_python_pythondir
418 unset am_cv_python_pyexecdir
420 if test "$found_py" = "1" -o "$found_py2" = "1"; then
421 AM_PATH_PYTHON([2.7], [
423 if test "$PYTHON_VERSION"; then
424 PYTHONS="$(echo $PYTHONS $PYTHON)"
425 PYTHON_VERSIONS="$(echo $PYTHON_VERSIONS $PYTHON_VERSION)"
430 if test "$found_py" = "1" -o "$found_py3" = "1"; then
431 # Reset everything, so that we can look for another Python.
434 unset PYTHON_CPPFLAGS
436 unset PYTHON_SITE_PKG
437 unset PYTHON_EXTRA_LIBS
438 unset PYTHON_EXTRA_LDFLAGS
439 unset ac_cv_path_PYTHON
440 unset am_cv_pathless_PYTHON
441 unset am_cv_python_version
442 unset am_cv_python_platform
443 unset am_cv_python_pythondir
444 unset am_cv_python_pyexecdir
445 AM_PATH_PYTHON([3.4], [
447 if test "$PYTHON_VERSION"; then
448 PYTHONS="$(echo $PYTHONS $PYTHON)"
449 PYTHON_VERSIONS="$(echo $PYTHON_VERSIONS $PYTHON_VERSION)"
454 # Recover some values lost in the second attempt to find Python.
455 PYTHON="$(echo $PYTHONS | cut -d ' ' -f 1)"
456 PYTHON_VERSION="$(echo $PYTHON_VERSIONS | cut -d ' ' -f 1)"
459 PYTHONS="$(echo $PYTHONS | tr '[[:space:]]' '\n' | sort | uniq | tr '\n' ' ' | sed -e 's/ $//')"
460 PYTHON_VERSIONS="$(echo $PYTHON_VERSIONS | tr '[[:space:]]' '\n' | sort | uniq | tr '\n' ' ' | sed -e 's/ $//')"
462 if test "$PYTHON_VERSIONS"; then
463 enabled_languages_v=$(echo $enabled_languages | sed -Ee "s/python[[23]]?/python ($PYTHON_VERSIONS)/")
464 enabled_languages=$(echo $enabled_languages | sed -Ee "s/python[[23]]?/python/")
466 if test "$explicit_languages" = "1"; then
469 *** Please install the python development packages.
472 enabled_languages=$(echo $enabled_languages | sed 's/python//')
476 AC_SUBST(PYTHONS, $PYTHONS)
480 AC_SUBST(ENABLED_LANGUAGES, $enabled_languages)
483 # Provide information about the build.
485 BUILD_REVISION="mym4_revision"
486 AC_SUBST(BUILD_REVISION)
487 AC_DEFINE_UNQUOTED(BUILD_REVISION, "$BUILD_REVISION",
488 [GIT commit id revision used to build this package])
491 BUILD_FILEVERSION=`echo "$PACKAGE_VERSION"|sed 's/\([0-9.]*\).*/\1./;s/\./,/g'`
493 BUILD_FILEVERSION="${BUILD_FILEVERSION}mym4_revision_dec"
494 AC_SUBST(BUILD_FILEVERSION)
496 AC_ARG_ENABLE([build-timestamp],
497 AC_HELP_STRING([--enable-build-timestamp],
498 [set an explicit build timestamp for reproducibility.
499 (default is the current time in ISO-8601 format)]),
500 [if test "$enableval" = "yes"; then
501 BUILD_TIMESTAMP=`date -u +%Y-%m-%dT%H:%M+0000 2>/dev/null || date`
503 BUILD_TIMESTAMP="$enableval"
505 [BUILD_TIMESTAMP="<none>"])
506 AC_SUBST(BUILD_TIMESTAMP)
507 AC_DEFINE_UNQUOTED(BUILD_TIMESTAMP, "$BUILD_TIMESTAMP",
508 [The time this package was configured for a build])
512 # Options to disable some regression tests
514 run_gpgconf_test="yes"
515 AC_ARG_ENABLE(gpgconf-test,
516 AC_HELP_STRING([--disable-gpgconf-test], [disable GPGCONF regression test]),
517 run_gpgconf_test=$enableval)
518 AM_CONDITIONAL(RUN_GPGCONF_TESTS, test "$run_gpgconf_test" = "yes")
521 AC_ARG_ENABLE(gpg-test,
522 AC_HELP_STRING([--disable-gpg-test], [disable GPG regression test]),
523 run_gpg_test=$enableval)
524 AM_CONDITIONAL(RUN_GPG_TESTS, test "$run_gpg_test" = "yes")
527 AC_ARG_ENABLE(gpgsm-test,
528 AC_HELP_STRING([--disable-gpgsm-test], [disable GPGSM regression test]),
529 run_gpgsm_test=$enableval)
530 AM_CONDITIONAL(RUN_GPGSM_TESTS, test "$run_gpgsm_test" = "yes")
533 AC_ARG_ENABLE(g13-test,
534 AC_HELP_STRING([--disable-g13-test], [disable G13 regression test]),
535 run_g13_test=$enableval)
536 AM_CONDITIONAL(RUN_G13_TESTS, test "$run_g13_test" = "yes")
539 # Checks for header files.
540 AC_CHECK_HEADERS_ONCE([locale.h sys/select.h sys/uio.h argp.h stdint.h
541 unistd.h sys/time.h sys/types.h sys/stat.h])
546 AC_CHECK_SIZEOF(unsigned int)
551 # We require uint64_t
552 if test "$ac_cv_header_stdint_h" != yes; then
555 *** No stdint.h and thus no uint64_t type. Can't build this library.
560 # A simple compile time check in gpgme.h for GNU/Linux systems that
561 # prevents a file offset bits mismatch between gpgme and the application.
562 NEED__FILE_OFFSET_BITS=0
563 if test "$have_w32_system" != yes; then
564 case "$ac_cv_sys_file_offset_bits" in
565 "" | no | unknown) ;;
567 NEED__FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits
571 AC_SUBST(NEED__FILE_OFFSET_BITS)
573 # Figure out platform dependent typedefs for gpgme.h
574 if test "$have_w32_system" = yes; then
575 INSERT__TYPEDEFS_FOR_GPGME_H="
578 typedef int64_t gpgme_off_t;
579 typedef int64_t gpgme_ssize_t;
581 typedef long gpgme_off_t;
582 typedef long gpgme_ssize_t;
584 API__OFF_T="gpgme_off_t"
585 API__SSIZE_T="gpgme_ssize_t"
587 INSERT__TYPEDEFS_FOR_GPGME_H="
588 #include <sys/types.h>
589 typedef off_t gpgme_off_t;
590 typedef ssize_t gpgme_ssize_t;"
592 API__SSIZE_T="ssize_t"
594 AC_SUBST(INSERT__TYPEDEFS_FOR_GPGME_H)
595 AM_SUBST_NOTMAKE(INSERT__TYPEDEFS_FOR_GPGME_H)
597 AM_SUBST_NOTMAKE(API__OFF_T)
598 AC_SUBST(API__SSIZE_T)
599 AM_SUBST_NOTMAKE(API__SSIZE_T)
601 # Checks for compiler features.
602 if test "$GCC" = yes; then
603 CFLAGS="$CFLAGS -Wall -Wcast-align -Wshadow -Wstrict-prototypes"
604 if test "$USE_MAINTAINER_MODE" = "yes"; then
605 CFLAGS="$CFLAGS -Wformat -Wno-format-y2k -Wformat-security"
607 # If -Wno-missing-field-initializers is supported we can enable a
608 # a bunch of really useful warnings.
609 AC_MSG_CHECKING([if gcc supports -Wno-missing-field-initializers])
610 _gcc_cflags_save=$CFLAGS
611 CFLAGS="-Wno-missing-field-initializers"
612 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],_gcc_wopt=yes,_gcc_wopt=no)
613 AC_MSG_RESULT($_gcc_wopt)
614 CFLAGS=$_gcc_cflags_save;
615 if test x"$_gcc_wopt" = xyes ; then
616 CFLAGS="$CFLAGS -W -Wextra -Wbad-function-cast"
617 CFLAGS="$CFLAGS -Wwrite-strings"
618 CFLAGS="$CFLAGS -Wdeclaration-after-statement"
619 CFLAGS="$CFLAGS -Wno-missing-field-initializers"
620 CFLAGS="$CFLAGS -Wno-sign-compare"
622 CXXFLAGS="$CXXFLAGS -Wall -Wextra -Wno-shadow"
624 AC_MSG_CHECKING([if gcc supports -Wpointer-arith])
625 _gcc_cflags_save=$CFLAGS
626 CFLAGS="-Wpointer-arith"
627 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],_gcc_wopt=yes,_gcc_wopt=no)
628 AC_MSG_RESULT($_gcc_wopt)
629 CFLAGS=$_gcc_cflags_save;
630 if test x"$_gcc_wopt" = xyes ; then
631 CFLAGS="$CFLAGS -Wpointer-arith"
634 if test "$have_w32_system" = yes; then
635 CFLAGS="$CFLAGS -mms-bitfields"
639 # Only used for debugging, so no serious test needed (for actual
640 # functionality you have to test libc as well, this only tests the
642 AC_CACHE_CHECK([for __thread],[gpgme_cv_tls_works],
643 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([__thread int foo;])],
644 gpgme_cv_tls_works=yes,gpgme_cv_tls_works=no))
645 if test "$gpgme_cv_tls_works" = yes; then
646 AC_DEFINE(HAVE_TLS, [1], [Define if __thread is supported])
650 # Checks for library functions.
651 AC_MSG_NOTICE([checking for libraries])
655 # Try to find a thread-safe version of ttyname().
656 gnupg_REPLACE_TTYNAME_R
657 if test "$ac_cv_func_ttyname_r" != yes; then
660 *** ttyname() is not thread-safe and ttyname_r() does not exist
664 # Try to find a thread-safe version of getenv().
665 have_thread_safe_getenv=no
667 if test $GLIBC21 = yes -o $have_w32_system = yes; then
668 have_thread_safe_getenv=yes
670 if test $have_thread_safe_getenv = yes; then
671 AC_DEFINE(HAVE_THREAD_SAFE_GETENV, [1], [Define if getenv() is thread-safe])
674 AC_CHECK_FUNCS(getenv_r, have_getenv_r=yes)
675 if test $have_getenv_r = no && test $have_thread_safe_getenv = no; then
678 *** getenv() is not thread-safe and getenv_r() does not exist
682 # For converting time strings to seconds since Epoch, we need the timegm
684 AC_CHECK_FUNCS(timegm)
685 if test "$ac_cv_func_timegm" != yes; then
688 *** timegm() not available - a non-thread-safe kludge will be used
689 *** and the TZ variable might be changed at runtime.
693 AC_CHECK_FUNCS(setlocale)
695 # Checking for libgpg-error.
697 AM_PATH_GPG_ERROR("$NEED_GPG_ERROR_VERSION",
698 have_gpg_error=yes, have_gpg_error=no)
699 AC_DEFINE(GPG_ERR_SOURCE_DEFAULT, GPG_ERR_SOURCE_GPGME,
700 [The default error source for GPGME.])
704 AM_PATH_LIBASSUAN("$NEED_LIBASSUAN_API:$NEED_LIBASSUAN_VERSION",
705 have_libassuan=yes, have_libassuan=no)
706 if test "$have_libassuan" = "yes"; then
707 AC_DEFINE_UNQUOTED(GPGME_LIBASSUAN_VERSION, "$libassuan_version",
708 [version of the libassuan library])
716 # Check for getgid etc
717 AC_CHECK_FUNCS(getgid getegid closefrom)
720 # Replacement functions.
721 AC_REPLACE_FUNCS(stpcpy)
722 AC_REPLACE_FUNCS(setenv)
724 # Assuan check for descriptor passing.
725 AC_CHECK_MEMBER(struct cmsghdr.cmsg_len,
726 [supports_descriptor_passing=yes],
727 [supports_descriptor_passing=no
730 *** Data structure for sending ancillary data missing.
731 *** Descriptor passing won't work.
736 #include <sys/types.h>
737 #include <sys/socket.h>
745 use_descriptor_passing=yes
746 AC_ARG_ENABLE(fd-passing,
747 AC_HELP_STRING([--disable-fd-passing], [do not use FD passing]),
748 use_descriptor_passing=$enableval)
750 if test "$supports_descriptor_passing" != "yes"; then
751 use_descriptor_passing=no
754 if test "$use_descriptor_passing" = "yes"; then
755 AC_DEFINE(USE_DESCRIPTOR_PASSING,1,
756 [Defined if descriptor passing is enabled and supported])
759 AM_CONDITIONAL(USE_DESCRIPTOR_PASSING, test "$use_descriptor_passing" = "yes")
763 if test "$use_descriptor_passing" = "yes" && test "$have_libassuan" = "yes"; then
766 if test "$uiserver" != "no"; then
767 AC_DEFINE(ENABLE_UISERVER, 1,
768 [Defined if we are building with uiserver support.])
770 AM_CONDITIONAL(HAVE_UISERVER, test "$uiserver" != "no")
773 # Option --disable-linux-getdents
775 # By default we use SYS_getdents on Linux to optimize fd closing
776 # before an exec. This option allows to switch this optimization off.
777 use_linux_getdents=yes
778 AC_ARG_ENABLE(linux-getdents,
779 AC_HELP_STRING([--disable-linux-getdents],
780 [do not use SYS_getdents on Linux]),
781 use_linux_getdents=$enableval)
782 if test "$use_linux_getdents" = "yes"; then
785 AC_DEFINE(USE_LINUX_GETDENTS,1,
786 [Defined if SYS_getdents can be used on Linux])
793 # Add a few constants to help porting to W32
795 AH_VERBATIM([SEPCONSTANTS],
797 /* Separators as used in $PATH and file name. */
798 #ifdef HAVE_DOSISH_SYSTEM
799 #define PATHSEP_C ';'
800 #define DIRSEP_C '\\'
801 #define DIRSEP_S "\\"
803 #define PATHSEP_C ':'
810 /* Definition of GCC specific attributes. */
812 # define GPGME_GCC_A_PURE __attribute__ ((__pure__))
814 # define GPGME_GCC_A_PURE
817 /* Under WindowsCE we need gpg-error's strerror macro. */
818 #define GPG_ERR_ENABLE_ERRNO_MACROS 1
820 #define CRIGHTBLURB "Copyright (C) 2000 Werner Koch\n" \
821 "Copyright (C) 2001--2018 g10 Code GmbH\n"
825 # Substitution used for gpgme-config
826 GPGME_CONFIG_LIBS="-lgpgme"
827 GPGME_CONFIG_CFLAGS=""
828 GPGME_CONFIG_HOST="$host"
829 GPGME_CONFIG_AVAIL_LANG="$enabled_languages"
830 AC_SUBST(GPGME_CONFIG_API_VERSION)
831 AC_SUBST(GPGME_CONFIG_LIBS)
832 AC_SUBST(GPGME_CONFIG_CFLAGS)
833 AC_SUBST(GPGME_CONFIG_HOST)
834 AC_SUBST(GPGME_CONFIG_AVAIL_LANG)
837 LTLIBOBJS=`echo "$LIB@&t@OBJS" |
838 sed 's,\.[[^.]]* ,.lo ,g;s,\.[[^.]]*$,.lo,'`
841 # Some checks for gpgme-tool
842 # Done at top: AC_CHECK_HEADER([argp.h])
843 AC_CHECK_TYPES([error_t], [],
844 [AC_DEFINE([error_t], [int],
845 [Define to a type to use for `error_t' if it is not otherwise available.])],
846 [#include <errno.h>])
849 # A substitution to set generated files in a Emacs buffer to read-only.
850 AC_SUBST(emacs_local_vars_begin, [['Local][ ][Variables:']])
851 AC_SUBST(emacs_local_vars_read_only, ['buffer-read-only: t'])
852 AC_SUBST(emacs_local_vars_end, ['End:'])
856 if test "$have_gpg_error" = "no"; then
860 *** You need libgpg-error to build this program.
861 ** This library is for example available at
862 *** ftp://ftp.gnupg.org/gcrypt/libgpg-error
863 *** (at least version $NEED_GPG_ERROR_VERSION is required.)
866 if test "$have_libassuan" = "no"; then
870 *** You need libassuan to build this program.
871 *** This library is for example available at
872 *** ftp://ftp.gnupg.org/gcrypt/libassuan/
873 *** (at least version $NEED_LIBASSUAN_VERSION (API $NEED_LIBASSUAN_API) is required).
877 if test "$die" = "yes"; then
880 *** Required libraries not found. Please consult the above messages
881 *** and install them before running configure again.
887 # Create config files
889 AC_CONFIG_FILES(Makefile src/Makefile
893 tests/opassuan/Makefile
897 AC_CONFIG_FILES(src/gpgme-config, chmod +x src/gpgme-config)
898 AC_CONFIG_FILES(lang/cpp/Makefile lang/cpp/src/Makefile)
899 AC_CONFIG_FILES(lang/cpp/src/GpgmeppConfig-w32.cmake.in)
900 AC_CONFIG_FILES(lang/cpp/src/GpgmeppConfig.cmake.in)
901 AC_CONFIG_FILES(lang/cpp/src/GpgmeppConfigVersion.cmake)
902 AC_CONFIG_FILES(lang/cpp/src/gpgmepp_version.h)
903 AC_CONFIG_FILES(lang/qt/Makefile lang/qt/src/Makefile)
904 AC_CONFIG_FILES(lang/qt/src/QGpgmeConfig-w32.cmake.in)
905 AC_CONFIG_FILES(lang/qt/src/QGpgmeConfig.cmake.in)
906 AC_CONFIG_FILES(lang/qt/src/QGpgmeConfigVersion.cmake)
907 AC_CONFIG_FILES(lang/qt/tests/Makefile)
908 AC_CONFIG_FILES(lang/qt/src/qgpgme_version.h)
909 AC_CONFIG_FILES([lang/Makefile lang/cl/Makefile lang/cl/gpgme.asd])
910 AM_COND_IF([HAVE_DOXYGEN], [AC_CONFIG_FILES([lang/qt/doc/Doxyfile])])
911 AC_CONFIG_FILES([lang/js/Makefile lang/js/src/Makefile
912 lang/js/BrowserTestExtension/Makefile
913 lang/js/DemoExtension/Makefile])
914 AC_CONFIG_FILES(lang/qt/doc/Makefile)
915 AC_CONFIG_FILES([lang/python/Makefile
916 lang/python/version.py
917 lang/python/tests/Makefile])
918 AC_CONFIG_FILES([lang/python/setup.py], [chmod a+x lang/python/setup.py])
922 GPGME v${VERSION} has been configured as follows:
924 Revision: mym4_revision (mym4_revision_dec)
928 FD Passing: $use_descriptor_passing
930 Language bindings: ${enabled_languages_v:-$enabled_languages}
932 if test "x${gpg_config_script_warn}" != x; then
934 Mismatches between the target platform and the to
935 be used libraries have been been detected for:
936 ${gpg_config_script_warn}
937 Please check above for warning messages.