Blame configure.ac

Packit Service 672cf4
# configure.ac for GPGME
Packit Service 672cf4
# Copyright (C) 2000 Werner Koch (dd9jn)
Packit Service 0ef63b
# Copyright (C) 2001-2018 g10 Code GmbH
Packit Service 672cf4
#
Packit Service 672cf4
# This file is part of GPGME.
Packit Service 672cf4
#
Packit Service 672cf4
# GPGME is free software; you can redistribute it and/or modify it
Packit Service 672cf4
# under the terms of the GNU Lesser General Public License as
Packit Service 672cf4
# published by the Free Software Foundation; either version 2.1 of the
Packit Service 672cf4
# License, or (at your option) any later version.
Packit Service 672cf4
#
Packit Service 672cf4
# GPGME is distributed in the hope that it will be useful, but WITHOUT
Packit Service 672cf4
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
Packit Service 672cf4
# or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General
Packit Service 672cf4
# Public License for more details.
Packit Service 672cf4
#
Packit Service 0ef63b
# You should have received a copy of the GNU Lesser General Public
Packit Service 0ef63b
# License along with this program; if not, see <https://gnu.org/licenses/>.
Packit Service 0ef63b
# SPDX-License-Identifier: LGPL-2.1-or-later
Packit Service 672cf4
Packit Service 672cf4
# (Process this file with autoconf to produce a configure script.)
Packit Service 672cf4
AC_PREREQ(2.59)
Packit Service 672cf4
min_automake_version="1.14"
Packit Service 672cf4
Packit Service 672cf4
# To build a release you need to create a tag with the version number
Packit Service 672cf4
# (git tag -s gpgme-n.m.k) and run "./autogen.sh --force".  Please
Packit Service 672cf4
# bump the version number immediately after the release and do another
Packit Service 672cf4
# commit and push so that the git magic is able to work.  See below
Packit Service 672cf4
# for the LT versions.
Packit Service 0ef63b
m4_define([mym4_package],[gpgme])
Packit Service 0ef63b
m4_define([mym4_major], [1])
Packit Service 0ef63b
m4_define([mym4_minor], [13])
Packit Service 0ef63b
m4_define([mym4_micro], [1])
Packit Service 0ef63b
Packit Service 0ef63b
# Below is m4 magic to extract and compute the git revision number,
Packit Service 0ef63b
# the decimalized short revision number, a beta version string and a
Packit Service 0ef63b
# flag indicating a development version (mym4_isbeta).  Note that the
Packit Service 0ef63b
# m4 processing is done by autoconf and not during the configure run.
Packit Service 0ef63b
m4_define([mym4_verslist], m4_split(m4_esyscmd([./autogen.sh --find-version] \
Packit Service 0ef63b
                           mym4_package mym4_major mym4_minor mym4_micro),[:]))
Packit Service 0ef63b
m4_define([mym4_isbeta],       m4_argn(2, mym4_verslist))
Packit Service 0ef63b
m4_define([mym4_version],      m4_argn(4, mym4_verslist))
Packit Service 0ef63b
m4_define([mym4_revision],     m4_argn(7, mym4_verslist))
Packit Service 0ef63b
m4_define([mym4_revision_dec], m4_argn(8, mym4_verslist))
Packit Service 0ef63b
m4_esyscmd([echo ]mym4_version[>VERSION])
Packit Service 0ef63b
AC_INIT([mym4_package],[mym4_version], [https://bugs.gnupg.org])
Packit Service 672cf4
Packit Service 672cf4
# LT Version numbers, remember to change them just *before* a release.
Packit Service 672cf4
#   (Code changed:			REVISION++)
Packit Service 672cf4
#   (Interfaces added/removed/changed:	CURRENT++, REVISION=0)
Packit Service 672cf4
#   (Interfaces added:			AGE++)
Packit Service 0ef63b
#   (Interfaces removed:		AGE=0)
Packit Service 672cf4
#
Packit Service 0ef63b
LIBGPGME_LT_CURRENT=33
Packit Service 0ef63b
LIBGPGME_LT_AGE=22
Packit Service 0ef63b
LIBGPGME_LT_REVISION=1
Packit Service 672cf4
Packit Service 672cf4
# If there is an ABI break in gpgmepp or qgpgme also bump the
Packit Service 672cf4
# version in IMPORTED_LOCATION in the GpgmeppConfig-w32.cmake.in.in
Packit Service 672cf4
Packit Service 0ef63b
LIBGPGMEPP_LT_CURRENT=16
Packit Service 0ef63b
LIBGPGMEPP_LT_AGE=10
Packit Service 672cf4
LIBGPGMEPP_LT_REVISION=0
Packit Service 672cf4
Packit Service 672cf4
LIBQGPGME_LT_CURRENT=10
Packit Service 672cf4
LIBQGPGME_LT_AGE=3
Packit Service 0ef63b
LIBQGPGME_LT_REVISION=4
Packit Service 0ef63b
################################################
Packit Service 0ef63b
Packit Service 0ef63b
AC_SUBST(LIBGPGME_LT_CURRENT)
Packit Service 0ef63b
AC_SUBST(LIBGPGME_LT_AGE)
Packit Service 0ef63b
AC_SUBST(LIBGPGME_LT_REVISION)
Packit Service 0ef63b
Packit Service 0ef63b
AC_SUBST(LIBGPGMEPP_LT_CURRENT)
Packit Service 0ef63b
AC_SUBST(LIBGPGMEPP_LT_AGE)
Packit Service 0ef63b
AC_SUBST(LIBGPGMEPP_LT_REVISION)
Packit Service 0ef63b
Packit Service 0ef63b
AC_SUBST(LIBQGPGME_LT_CURRENT)
Packit Service 0ef63b
AC_SUBST(LIBQGPGME_LT_AGE)
Packit Service 0ef63b
AC_SUBST(LIBQGPGME_LT_REVISION)
Packit Service 672cf4
Packit Service 672cf4
# If the API is changed in an incompatible way: increment the next counter.
Packit Service 672cf4
GPGME_CONFIG_API_VERSION=1
Packit Service 672cf4
##############################################
Packit Service 672cf4
Packit Service 672cf4
NEED_GPG_ERROR_VERSION=1.24
Packit Service 672cf4
NEED_LIBASSUAN_API=2
Packit Service 672cf4
NEED_LIBASSUAN_VERSION=2.4.2
Packit Service 672cf4
Packit Service 672cf4
Packit Service 0ef63b
VERSION_MAJOR=mym4_major
Packit Service 0ef63b
VERSION_MINOR=mym4_minor
Packit Service 0ef63b
VERSION_MICRO=mym4_micro
Packit Service 672cf4
Packit Service 672cf4
AC_CONFIG_AUX_DIR([build-aux])
Packit Service 672cf4
AC_CONFIG_MACRO_DIR([m4])
Packit Service 672cf4
AC_CONFIG_SRCDIR(src/gpgme.h.in)
Packit Service 0ef63b
AC_CONFIG_HEADER(conf/config.h)
Packit Service 672cf4
AM_INIT_AUTOMAKE([serial-tests dist-bzip2 no-dist-gzip])
Packit Service 672cf4
AM_MAINTAINER_MODE
Packit Service 672cf4
AC_CANONICAL_HOST
Packit Service 672cf4
AM_SILENT_RULES
Packit Service 672cf4
AC_ARG_VAR(SYSROOT,[locate config scripts also below that directory])
Packit Service 672cf4
Packit Service 672cf4
# Enable GNU extensions on systems that have them.
Packit Service 672cf4
AC_GNU_SOURCE
Packit Service 672cf4
Packit Service 0ef63b
# Taken from mpfr-4.0.1, then modified for LDADD_FOR_TESTS_KLUDGE
Packit Service 0ef63b
dnl Under Linux, make sure that the old dtags are used if LD_LIBRARY_PATH
Packit Service 0ef63b
dnl is defined. The issue is that with the new dtags, LD_LIBRARY_PATH has
Packit Service 0ef63b
dnl the precedence over the run path, so that if a compatible MPFR library
Packit Service 0ef63b
dnl is installed in some directory from $LD_LIBRARY_PATH, then the tested
Packit Service 0ef63b
dnl MPFR library will be this library instead of the MPFR library from the
Packit Service 0ef63b
dnl build tree. Other OS with the same issue might be added later.
Packit Service 0ef63b
dnl
Packit Service 0ef63b
dnl References:
Packit Service 0ef63b
dnl   https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=859732
Packit Service 0ef63b
dnl   http://lists.gnu.org/archive/html/libtool/2017-05/msg00000.html
Packit Service 0ef63b
dnl
Packit Service 0ef63b
dnl We need to check whether --disable-new-dtags is supported as alternate
Packit Service 0ef63b
dnl linkers may be used (e.g., with tcc: CC=tcc LD=tcc).
Packit Service 0ef63b
dnl
Packit Service 0ef63b
case $host in
Packit Service 0ef63b
  *-*-linux*)
Packit Service 0ef63b
    if test -n "$LD_LIBRARY_PATH"; then
Packit Service 0ef63b
      saved_LDFLAGS="$LDFLAGS"
Packit Service 0ef63b
      LDADD_FOR_TESTS_KLUDGE="-Wl,--disable-new-dtags"
Packit Service 0ef63b
      LDFLAGS="$LDFLAGS $LDADD_FOR_TESTS_KLUDGE"
Packit Service 0ef63b
      AC_MSG_CHECKING(whether --disable-new-dtags is supported by the linker)
Packit Service 0ef63b
      AC_LINK_IFELSE([AC_LANG_SOURCE([[
Packit Service 0ef63b
int main (void) { return 0; }
Packit Service 0ef63b
      ]])],
Packit Service 0ef63b
      [AC_MSG_RESULT(yes (use it since LD_LIBRARY_PATH is set))],
Packit Service 0ef63b
      [AC_MSG_RESULT(no)
Packit Service 0ef63b
       LDADD_FOR_TESTS_KLUDGE=""
Packit Service 0ef63b
      ])
Packit Service 0ef63b
      LDFLAGS="$saved_LDFLAGS"
Packit Service 0ef63b
    fi
Packit Service 0ef63b
    ;;
Packit Service 0ef63b
esac
Packit Service 0ef63b
AC_SUBST([LDADD_FOR_TESTS_KLUDGE])
Packit Service 0ef63b
Packit Service 672cf4
AH_VERBATIM([_REENTRANT],
Packit Service 672cf4
[/* To allow the use of GPGME in multithreaded programs we have to use
Packit Service 672cf4
  special features from the library.
Packit Service 672cf4
  IMPORTANT: gpgme is not yet fully reentrant and you should use it
Packit Service 672cf4
  only from one thread.  */
Packit Service 672cf4
#ifndef _REENTRANT
Packit Service 672cf4
# define _REENTRANT 1
Packit Service 672cf4
#endif])
Packit Service 672cf4
Packit Service 672cf4
AC_PROG_CC
Packit Service 672cf4
AC_PROG_CPP
Packit Service 672cf4
AC_PROG_CXX
Packit Service 672cf4
Packit Service 672cf4
# Note: A suitable gitlog-to-changelog script can be found in GnuPG master.
Packit Service 672cf4
AC_CHECK_PROGS(GITLOG_TO_CHANGELOG, gitlog-to-changelog, [gitlog-to-changelog])
Packit Service 672cf4
Packit Service 672cf4
AC_SUBST(VERSION_MAJOR)
Packit Service 672cf4
AC_SUBST(VERSION_MINOR)
Packit Service 672cf4
AC_SUBST(VERSION_MICRO)
Packit Service 0ef63b
Packit Service 0ef63b
VERSION_NUMBER=m4_esyscmd(printf "0x%02x%02x%02x" mym4_major \
Packit Service 0ef63b
                          mym4_minor mym4_micro)
Packit Service 672cf4
AC_SUBST(VERSION_NUMBER)
Packit Service 672cf4
Packit Service 672cf4
# We need to compile and run a program on the build machine.  A
Packit Service 672cf4
# comment in libgpg-error says that the AC_PROG_CC_FOR_BUILD macro in
Packit Service 672cf4
# the AC archive is broken for autoconf 2.57.  Given that there is no
Packit Service 672cf4
# newer version of that macro, we assume that it is also broken for
Packit Service 672cf4
# autoconf 2.61 and thus we use a simple but usually sufficient
Packit Service 672cf4
# approach.
Packit Service 672cf4
AC_MSG_CHECKING(for cc for build)
Packit Service 672cf4
if test "$cross_compiling" = "yes"; then
Packit Service 672cf4
  CC_FOR_BUILD="${CC_FOR_BUILD-cc}"
Packit Service 672cf4
else
Packit Service 672cf4
  CC_FOR_BUILD="${CC_FOR_BUILD-$CC}"
Packit Service 672cf4
fi
Packit Service 672cf4
AC_MSG_RESULT($CC_FOR_BUILD)
Packit Service 672cf4
AC_ARG_VAR(CC_FOR_BUILD,[build system C compiler])
Packit Service 672cf4
Packit Service 672cf4
Packit Service 672cf4
# Don't default to build static libs.
Packit Service 672cf4
LT_PREREQ([2.2.6])
Packit Service 672cf4
LT_INIT([win32-dll disable-static])
Packit Service 672cf4
LT_LANG([Windows Resource])
Packit Service 672cf4
Packit Service 672cf4
# For now we hardcode the use of version scripts.  It would be better
Packit Service 672cf4
# to write a test for this or even implement this within libtool.
Packit Service 672cf4
have_ld_version_script=no
Packit Service 672cf4
case "${host}" in
Packit Service 672cf4
    *-*-linux*)
Packit Service 672cf4
	have_ld_version_script=yes
Packit Service 672cf4
        ;;
Packit Service 672cf4
    *-*-gnu*)
Packit Service 672cf4
	have_ld_version_script=yes
Packit Service 672cf4
        ;;
Packit Service 672cf4
    *-apple-darwin*)
Packit Service 672cf4
        AC_DEFINE(_DARWIN_C_SOURCE, 900000L,
Packit Service 672cf4
                  Expose all libc features (__DARWIN_C_FULL).)
Packit Service 672cf4
        AC_DEFINE(_XOPEN_SOURCE, 500, Activate POSIX interface on MacOS X)
Packit Service 672cf4
        ;;
Packit Service 672cf4
esac
Packit Service 672cf4
Packit Service 672cf4
AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, test "$have_ld_version_script" = "yes")
Packit Service 672cf4
Packit Service 672cf4
GPG_DEFAULT=no
Packit Service 672cf4
GPGSM_DEFAULT=no
Packit Service 672cf4
GPGCONF_DEFAULT=no
Packit Service 672cf4
G13_DEFAULT=no
Packit Service 672cf4
component_system=None
Packit Service 672cf4
have_dosish_system=no
Packit Service 672cf4
have_android_system=no
Packit Service 672cf4
have_w32_system=no
Packit Service 672cf4
have_w64_system=no
Packit Service 672cf4
have_macos_system=no
Packit Service 672cf4
build_w32_glib=no
Packit Service 672cf4
build_w32_qt=no
Packit Service 0ef63b
available_languages="cl cpp python qt"
Packit Service 672cf4
default_languages="cl cpp python qt"
Packit Service 672cf4
case "${host}" in
Packit Service 672cf4
    x86_64-*mingw32*)
Packit Service 672cf4
        have_w64_system=yes
Packit Service 672cf4
        ;;
Packit Service 672cf4
    *-linux-androideabi)
Packit Service 672cf4
        have_android_system=yes
Packit Service 672cf4
        ;;
Packit Service 672cf4
    *-apple-darwin*)
Packit Service 672cf4
        have_macos_system=yes
Packit Service 672cf4
        ;;
Packit Service 672cf4
esac
Packit Service 672cf4
case "${host}" in
Packit Service 0ef63b
    *-mingw32*)
Packit Service 672cf4
	have_dosish_system=yes
Packit Service 672cf4
        have_w32_system=yes
Packit Service 672cf4
        GPG_DEFAULT='c:\\gnupg\\gpg.exe'
Packit Service 672cf4
	GPGSM_DEFAULT='c:\\gnupg\\gpgsm.exe'
Packit Service 672cf4
        GPGCONF_DEFAULT='c:\\gnupg\\gpgconf.exe'
Packit Service 672cf4
        G13_DEFAULT='c:\\gnupg\\g13.exe'
Packit Service 672cf4
        #component_system='COM+'
Packit Service 672cf4
Packit Service 672cf4
	AM_PATH_GLIB_2_0
Packit Service 672cf4
	AC_ARG_ENABLE(w32-glib,
Packit Service 672cf4
	    AC_HELP_STRING([--enable-w32-glib], [build GPGME Glib for W32]),
Packit Service 672cf4
	    		   build_w32_glib=$enableval)
Packit Service 672cf4
       ;;
Packit Service 672cf4
    *)
Packit Service 672cf4
Packit Service 672cf4
	# XXX: Probably use exec-prefix here?
Packit Service 672cf4
#	GPG_DEFAULT='/usr/bin/gpg'
Packit Service 672cf4
#	GPGSM_DEFAULT='/usr/bin/gpgsm'
Packit Service 672cf4
#	GPGCONF_DEFAULT='/usr/bin/gpgconf'
Packit Service 672cf4
#	G13_DEFAULT='/usr/bin/g13'
Packit Service 672cf4
	;;
Packit Service 672cf4
esac
Packit Service 672cf4
Packit Service 672cf4
if test "$have_dosish_system" = yes; then
Packit Service 672cf4
   AC_DEFINE(HAVE_DOSISH_SYSTEM,1,
Packit Service 672cf4
             [Defined if we run on some of the PCDOS like systems
Packit Service 672cf4
              (DOS, Windoze. OS/2) with special properties like
Packit Service 672cf4
              no file modes])
Packit Service 672cf4
fi
Packit Service 672cf4
AM_CONDITIONAL(HAVE_DOSISH_SYSTEM, test "$have_dosish_system" = yes)
Packit Service 672cf4
Packit Service 672cf4
if test "$have_w32_system" = yes; then
Packit Service 672cf4
   AC_DEFINE(HAVE_W32_SYSTEM,1,
Packit Service 672cf4
             [Defined if we run on any kind of W32 API based system])
Packit Service 672cf4
fi
Packit Service 672cf4
AM_CONDITIONAL(HAVE_W32_SYSTEM, test "$have_w32_system" = yes)
Packit Service 672cf4
Packit Service 672cf4
if test "$have_w64_system" = yes; then
Packit Service 672cf4
   AC_DEFINE(HAVE_W64_SYSTEM,1,
Packit Service 672cf4
             [Defined if we run on a 64 bit W32 API based system])
Packit Service 672cf4
fi
Packit Service 672cf4
AM_CONDITIONAL(HAVE_W64_SYSTEM, test "$have_w64_system" = yes)
Packit Service 672cf4
Packit Service 672cf4
if test "$have_android_system" = yes; then
Packit Service 672cf4
   AC_DEFINE(HAVE_ANDROID_SYSTEM,1, [Defined if we build for an Android system])
Packit Service 672cf4
fi
Packit Service 672cf4
AM_CONDITIONAL(HAVE_ANDROID_SYSTEM, test "$have_android_system" = yes)
Packit Service 672cf4
Packit Service 672cf4
if test "$have_macos_system" = yes; then
Packit Service 672cf4
   AC_DEFINE(HAVE_MACOS_SYSTEM,1,
Packit Service 672cf4
             [Defined if we build for an MacOS system])
Packit Service 672cf4
fi
Packit Service 672cf4
AM_CONDITIONAL(HAVE_MACOS_SYSTEM, test "$have_macos_system" = yes)
Packit Service 672cf4
Packit Service 672cf4
AM_CONDITIONAL(BUILD_W32_GLIB, test "$build_w32_glib" = yes)
Packit Service 672cf4
Packit Service 672cf4
Packit Service 672cf4
AC_ARG_ENABLE([fixed-path],
Packit Service 672cf4
              AC_HELP_STRING([--enable-fixed-path=PATH],
Packit Service 672cf4
                             [locate binaries only via this PATH]),
Packit Service 672cf4
              [fixed_search_path="$enableval"],
Packit Service 672cf4
              [fixed_search_path=""])
Packit Service 672cf4
if test x$fixed_search_path != x ; then
Packit Service 672cf4
  AC_DEFINE_UNQUOTED(FIXED_SEARCH_PATH, "$fixed_search_path",
Packit Service 672cf4
                    [Locate binaries only via this PATH])
Packit Service 672cf4
fi
Packit Service 672cf4
Packit Service 672cf4
Packit Service 672cf4
# Note: You need to declare all possible languages also in
Packit Service 672cf4
#       lang/Makefile.am's DIST_SUBDIRS.
Packit Service 672cf4
AC_ARG_ENABLE([languages],
Packit Service 672cf4
              AC_HELP_STRING([--enable-languages=languages],
Packit Service 672cf4
                             [enable only specific language bindings]),
Packit Service 672cf4
                             [enabled_languages=`echo $enableval | \
Packit Service 672cf4
                             tr ',:' '  ' | tr '[A-Z]' '[a-z]' | \
Packit Service 672cf4
                             sed 's/c++/cpp/'`],
Packit Service 672cf4
                             [enabled_languages="maybe"])
Packit Service 672cf4
if test "x$enabled_languages" = "x" \
Packit Service 672cf4
   -o "$enabled_languages" = "no"; then
Packit Service 672cf4
   enabled_languages=
Packit Service 672cf4
fi
Packit Service 672cf4
Packit Service 672cf4
# If languages are explicitly set missing requirements
Packit Service 672cf4
# for the languages are treated as errors otherwise
Packit Service 672cf4
# there will be a warning.
Packit Service 672cf4
explicit_languages=1
Packit Service 672cf4
if test "x$enabled_languages" = "xmaybe"; then
Packit Service 672cf4
    explicit_languages=0
Packit Service 672cf4
    enabled_languages="$default_languages"
Packit Service 672cf4
fi
Packit Service 672cf4
Packit Service 672cf4
for language in $enabled_languages; do
Packit Service 672cf4
    LIST_MEMBER($language, $available_languages)
Packit Service 672cf4
    if test "$found" = "0"; then
Packit Service 672cf4
       AC_MSG_ERROR([unsupported language binding specified])
Packit Service 672cf4
    fi
Packit Service 672cf4
done
Packit Service 672cf4
Packit Service 672cf4
Packit Service 672cf4
Packit Service 672cf4
# Enable C++ 11 if cpp language is requested
Packit Service 672cf4
LIST_MEMBER("cpp", $enabled_languages)
Packit Service 672cf4
if test "$found" = "1"; then
Packit Service 672cf4
    AX_CXX_COMPILE_STDCXX(11, noext, optional)
Packit Service 672cf4
    if test "$HAVE_CXX11" != "1"; then
Packit Service 672cf4
        if test "$explicit_languages" = "1"; then
Packit Service 672cf4
            AC_MSG_ERROR([[
Packit Service 672cf4
***
Packit Service 672cf4
*** A compiler with c++11 support is required for the c++ binding.
Packit Service 672cf4
***]])
Packit Service 672cf4
        else
Packit Service 672cf4
            enabled_languages=$(echo $enabled_languages | sed 's/cpp//')
Packit Service 672cf4
            enabled_languages=$(echo $enabled_languages | sed 's/qt//')
Packit Service 672cf4
            AC_MSG_WARN([[
Packit Service 672cf4
***
Packit Service 672cf4
*** No c++11 support detected. C++ and Qt bindings will be disabled.
Packit Service 672cf4
***]])
Packit Service 672cf4
        fi
Packit Service 672cf4
    fi
Packit Service 672cf4
fi
Packit Service 672cf4
Packit Service 672cf4
# Check that if qt is enabled cpp also is enabled
Packit Service 672cf4
LIST_MEMBER("qt", $enabled_languages)
Packit Service 672cf4
if test "$found" = "1"; then
Packit Service 672cf4
    # We need to ensure that in the language order qt comes after cpp
Packit Service 672cf4
    # so we remove qt first and explicitly add it as last list member.
Packit Service 672cf4
    enabled_languages=$(echo $enabled_languages | sed 's/qt//')
Packit Service 672cf4
    LIST_MEMBER("cpp", $enabled_languages)
Packit Service 672cf4
    if test "$found" = "0"; then
Packit Service 672cf4
        AC_MSG_ERROR([[
Packit Service 672cf4
***
Packit Service 672cf4
*** Qt language binding depends on cpp binding.
Packit Service 672cf4
***]])
Packit Service 672cf4
    fi
Packit Service 672cf4
    FIND_QT
Packit Service 672cf4
    if test "$have_qt5_libs" != "yes"; then
Packit Service 672cf4
        if test "$explicit_languages" = "1"; then
Packit Service 672cf4
        AC_MSG_ERROR([[
Packit Service 672cf4
***
Packit Service 672cf4
*** Qt5 (Qt5Core) is required for Qt binding.
Packit Service 672cf4
***]])
Packit Service 672cf4
        else
Packit Service 672cf4
           AC_MSG_WARN([[
Packit Service 672cf4
***
Packit Service 672cf4
*** Qt5 (Qt5Core) not found Qt Binding will be disabled.
Packit Service 672cf4
***]])
Packit Service 672cf4
        fi
Packit Service 672cf4
    else
Packit Service 672cf4
        enabled_languages=`echo $enabled_languages qt`
Packit Service 672cf4
Packit Service 672cf4
        AC_CHECK_PROGS([DOXYGEN], [doxygen])
Packit Service 672cf4
        if test -z "$DOXYGEN";
Packit Service 0ef63b
            # This is not highlighted because it's not really important.
Packit Service 672cf4
            then AC_MSG_WARN([Doxygen not found - Qt binding doc will not be built.])
Packit Service 672cf4
        fi
Packit Service 672cf4
        AC_CHECK_PROGS([GRAPHVIZ], [dot])
Packit Service 672cf4
        if test -z "$GRAPHVIZ";
Packit Service 672cf4
            then AC_MSG_WARN([Graphviz not found - Qt binding doc will not have diagrams.])
Packit Service 672cf4
        fi
Packit Service 672cf4
    fi
Packit Service 672cf4
fi
Packit Service 672cf4
AM_CONDITIONAL([HAVE_DOXYGEN],
Packit Service 672cf4
               [test -n "$DOXYGEN"])
Packit Service 672cf4
if test -n "$GRAPHVIZ"; then
Packit Service 672cf4
    HAVE_DOT="YES"
Packit Service 672cf4
else
Packit Service 672cf4
    HAVE_DOT="NO"
Packit Service 672cf4
fi
Packit Service 672cf4
AC_SUBST(HAVE_DOT)
Packit Service 672cf4
Packit Service 672cf4
# Python bindings.
Packit Service 672cf4
LIST_MEMBER("python", $enabled_languages)
Packit Service 672cf4
found_py=$found
Packit Service 0ef63b
if test "$found_py" = "1"; then
Packit Service 672cf4
    AX_PKG_SWIG
Packit Service 672cf4
    if test -z "$SWIG"; then
Packit Service 672cf4
        if test "$explicit_languages" = "1"; then
Packit Service 672cf4
            AC_MSG_ERROR([[
Packit Service 672cf4
***
Packit Service 672cf4
*** You need SWIG to build the Python bindings.
Packit Service 672cf4
***]])
Packit Service 672cf4
        else
Packit Service 672cf4
            enabled_languages=$(echo $enabled_languages | sed 's/python//')
Packit Service 672cf4
        fi
Packit Service 672cf4
    else
Packit Service 0ef63b
        # Reset the version collecting vars.
Packit Service 672cf4
	PYTHONS=
Packit Service 672cf4
	PYTHON_VERSIONS=
Packit Service 672cf4
Packit Service 672cf4
	if test "$found_py" = "1" -o "$found_py3" = "1"; then
Packit Service 0ef63b
	  # Reset everything, so that we can look for another Python.
Packit Service 0ef63b
          m4_foreach([mym4pythonver],
Packit Service 0ef63b
                     [[2.7],[3.4],[3.5],[3.6],[3.7],[3.8],[all]],
Packit Service 0ef63b
           [unset PYTHON
Packit Service 672cf4
	    unset PYTHON_VERSION
Packit Service 672cf4
	    unset PYTHON_CPPFLAGS
Packit Service 672cf4
	    unset PYTHON_LDFLAGS
Packit Service 672cf4
	    unset PYTHON_SITE_PKG
Packit Service 672cf4
	    unset PYTHON_EXTRA_LIBS
Packit Service 672cf4
	    unset PYTHON_EXTRA_LDFLAGS
Packit Service 672cf4
	    unset ac_cv_path_PYTHON
Packit Service 672cf4
	    unset am_cv_pathless_PYTHON
Packit Service 672cf4
	    unset am_cv_python_version
Packit Service 672cf4
	    unset am_cv_python_platform
Packit Service 672cf4
	    unset am_cv_python_pythondir
Packit Service 672cf4
	    unset am_cv_python_pyexecdir
Packit Service 0ef63b
	    AM_PATH_PYTHON(mym4pythonver, [
Packit Service 672cf4
		AX_PYTHON_DEVEL
Packit Service 672cf4
		if test "$PYTHON_VERSION"; then
Packit Service 672cf4
			PYTHONS="$(echo $PYTHONS $PYTHON)"
Packit Service 672cf4
			PYTHON_VERSIONS="$(echo $PYTHON_VERSIONS $PYTHON_VERSION)"
Packit Service 672cf4
		fi
Packit Service 0ef63b
	    ], :, m4_if([mym4pythonver],[all],[],[python]mym4pythonver))
Packit Service 0ef63b
           ])
Packit Service 672cf4
	fi
Packit Service 672cf4
Packit Service 672cf4
	# Recover some values lost in the second attempt to find Python.
Packit Service 672cf4
	PYTHON="$(echo $PYTHONS | cut -d ' ' -f 1)"
Packit Service 672cf4
	PYTHON_VERSION="$(echo $PYTHON_VERSIONS | cut -d ' ' -f 1)"
Packit Service 672cf4
Packit Service 672cf4
	# Remove duplicates.
Packit Service 672cf4
	PYTHONS="$(echo $PYTHONS | tr '[[:space:]]' '\n' | sort | uniq | tr '\n' ' ' | sed -e 's/ $//')"
Packit Service 672cf4
	PYTHON_VERSIONS="$(echo $PYTHON_VERSIONS | tr '[[:space:]]' '\n' | sort | uniq | tr '\n' ' ' | sed -e 's/ $//')"
Packit Service 672cf4
Packit Service 672cf4
	if test "$PYTHON_VERSIONS"; then
Packit Service 672cf4
	   enabled_languages_v=$(echo $enabled_languages | sed -Ee "s/python[[23]]?/python ($PYTHON_VERSIONS)/")
Packit Service 672cf4
	   enabled_languages=$(echo $enabled_languages | sed -Ee "s/python[[23]]?/python/")
Packit Service 672cf4
	else
Packit Service 672cf4
            if test "$explicit_languages" = "1"; then
Packit Service 672cf4
                AC_MSG_ERROR([[
Packit Service 672cf4
***
Packit Service 672cf4
*** Please install the python development packages.
Packit Service 672cf4
***]])
Packit Service 672cf4
	    else
Packit Service 672cf4
                enabled_languages=$(echo $enabled_languages | sed 's/python//')
Packit Service 672cf4
            fi
Packit Service 672cf4
	fi
Packit Service 672cf4
Packit Service 672cf4
	AC_SUBST(PYTHONS, $PYTHONS)
Packit Service 672cf4
    fi
Packit Service 672cf4
fi
Packit Service 672cf4
Packit Service 672cf4
AC_SUBST(ENABLED_LANGUAGES, $enabled_languages)
Packit Service 672cf4
Packit Service 672cf4
#
Packit Service 672cf4
# Provide information about the build.
Packit Service 672cf4
#
Packit Service 672cf4
BUILD_REVISION="mym4_revision"
Packit Service 672cf4
AC_SUBST(BUILD_REVISION)
Packit Service 672cf4
AC_DEFINE_UNQUOTED(BUILD_REVISION, "$BUILD_REVISION",
Packit Service 672cf4
                   [GIT commit id revision used to build this package])
Packit Service 672cf4
Packit Service 672cf4
changequote(,)dnl
Packit Service 0ef63b
BUILD_VERSION=`echo "$PACKAGE_VERSION" | sed 's/\([0-9.]*\).*/\1./'`
Packit Service 672cf4
changequote([,])dnl
Packit Service 0ef63b
BUILD_VERSION="${BUILD_VERSION}mym4_revision_dec"
Packit Service 0ef63b
BUILD_FILEVERSION=`echo "${BUILD_VERSION}" | tr . ,`
Packit Service 0ef63b
AC_SUBST(BUILD_VERSION)
Packit Service 672cf4
AC_SUBST(BUILD_FILEVERSION)
Packit Service 672cf4
Packit Service 672cf4
AC_ARG_ENABLE([build-timestamp],
Packit Service 672cf4
  AC_HELP_STRING([--enable-build-timestamp],
Packit Service 672cf4
                 [set an explicit build timestamp for reproducibility.
Packit Service 672cf4
                  (default is the current time in ISO-8601 format)]),
Packit Service 672cf4
     [if test "$enableval" = "yes"; then
Packit Service 672cf4
        BUILD_TIMESTAMP=`date -u +%Y-%m-%dT%H:%M+0000 2>/dev/null || date`
Packit Service 672cf4
      else
Packit Service 672cf4
        BUILD_TIMESTAMP="$enableval"
Packit Service 672cf4
      fi],
Packit Service 672cf4
     [BUILD_TIMESTAMP="<none>"])
Packit Service 672cf4
AC_SUBST(BUILD_TIMESTAMP)
Packit Service 672cf4
AC_DEFINE_UNQUOTED(BUILD_TIMESTAMP, "$BUILD_TIMESTAMP",
Packit Service 672cf4
                   [The time this package was configured for a build])
Packit Service 672cf4
Packit Service 672cf4
Packit Service 672cf4
#
Packit Service 672cf4
# Options to disable some regression tests
Packit Service 672cf4
#
Packit Service 672cf4
run_gpgconf_test="yes"
Packit Service 672cf4
AC_ARG_ENABLE(gpgconf-test,
Packit Service 672cf4
  AC_HELP_STRING([--disable-gpgconf-test], [disable GPGCONF regression test]),
Packit Service 672cf4
         run_gpgconf_test=$enableval)
Packit Service 672cf4
AM_CONDITIONAL(RUN_GPGCONF_TESTS, test "$run_gpgconf_test" = "yes")
Packit Service 672cf4
Packit Service 672cf4
run_gpg_test="yes"
Packit Service 672cf4
AC_ARG_ENABLE(gpg-test,
Packit Service 672cf4
  AC_HELP_STRING([--disable-gpg-test], [disable GPG regression test]),
Packit Service 672cf4
         run_gpg_test=$enableval)
Packit Service 672cf4
AM_CONDITIONAL(RUN_GPG_TESTS, test "$run_gpg_test" = "yes")
Packit Service 672cf4
Packit Service 672cf4
run_gpgsm_test="yes"
Packit Service 672cf4
AC_ARG_ENABLE(gpgsm-test,
Packit Service 672cf4
  AC_HELP_STRING([--disable-gpgsm-test], [disable GPGSM regression test]),
Packit Service 672cf4
         run_gpgsm_test=$enableval)
Packit Service 672cf4
AM_CONDITIONAL(RUN_GPGSM_TESTS, test "$run_gpgsm_test" = "yes")
Packit Service 672cf4
Packit Service 672cf4
run_g13_test="yes"
Packit Service 672cf4
AC_ARG_ENABLE(g13-test,
Packit Service 672cf4
  AC_HELP_STRING([--disable-g13-test], [disable G13 regression test]),
Packit Service 672cf4
         run_g13_test=$enableval)
Packit Service 672cf4
AM_CONDITIONAL(RUN_G13_TESTS, test "$run_g13_test" = "yes")
Packit Service 672cf4
Packit Service 672cf4
Packit Service 672cf4
# Checks for header files.
Packit Service 0ef63b
AC_CHECK_HEADERS_ONCE([locale.h sys/select.h sys/uio.h argp.h stdint.h
Packit Service 672cf4
                       unistd.h sys/time.h sys/types.h sys/stat.h])
Packit Service 672cf4
Packit Service 672cf4
Packit Service 672cf4
# Type checks.
Packit Service 672cf4
AC_C_INLINE
Packit Service 672cf4
AC_CHECK_SIZEOF(unsigned int)
Packit Service 672cf4
AC_SYS_LARGEFILE
Packit Service 672cf4
AC_TYPE_OFF_T
Packit Service 672cf4
AC_TYPE_UINTPTR_T
Packit Service 672cf4
Packit Service 0ef63b
# We require uint64_t
Packit Service 0ef63b
if test "$ac_cv_header_stdint_h" != yes; then
Packit Service 0ef63b
   AC_MSG_ERROR([[
Packit Service 0ef63b
***
Packit Service 0ef63b
*** No stdint.h and thus no uint64_t type.  Can't build this library.
Packit Service 0ef63b
***]])
Packit Service 0ef63b
fi
Packit Service 0ef63b
Packit Service 0ef63b
Packit Service 672cf4
# A simple compile time check in gpgme.h for GNU/Linux systems that
Packit Service 672cf4
# prevents a file offset bits mismatch between gpgme and the application.
Packit Service 672cf4
NEED__FILE_OFFSET_BITS=0
Packit Service 672cf4
if test "$have_w32_system" != yes; then
Packit Service 672cf4
  case "$ac_cv_sys_file_offset_bits" in
Packit Service 672cf4
    "" | no | unknown) ;;
Packit Service 672cf4
    *)
Packit Service 672cf4
    NEED__FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits
Packit Service 672cf4
    ;;
Packit Service 672cf4
  esac
Packit Service 672cf4
fi
Packit Service 672cf4
AC_SUBST(NEED__FILE_OFFSET_BITS)
Packit Service 672cf4
Packit Service 672cf4
# Figure out platform dependent typedefs for gpgme.h
Packit Service 672cf4
if test "$have_w32_system" = yes; then
Packit Service 672cf4
    INSERT__TYPEDEFS_FOR_GPGME_H="
Packit Service 672cf4
#ifdef _WIN64
Packit Service 672cf4
# include <stdint.h>
Packit Service 672cf4
  typedef int64_t gpgme_off_t;
Packit Service 672cf4
  typedef int64_t gpgme_ssize_t;
Packit Service 672cf4
#else /* _WIN32 */
Packit Service 672cf4
  typedef long gpgme_off_t;
Packit Service 672cf4
  typedef long gpgme_ssize_t;
Packit Service 672cf4
#endif /* _WIN32 */"
Packit Service 672cf4
    API__OFF_T="gpgme_off_t"
Packit Service 672cf4
    API__SSIZE_T="gpgme_ssize_t"
Packit Service 672cf4
else
Packit Service 672cf4
    INSERT__TYPEDEFS_FOR_GPGME_H="
Packit Service 672cf4
#include <sys/types.h>
Packit Service 672cf4
typedef off_t   gpgme_off_t;
Packit Service 672cf4
typedef ssize_t gpgme_ssize_t;"
Packit Service 672cf4
    API__OFF_T="off_t"
Packit Service 672cf4
    API__SSIZE_T="ssize_t"
Packit Service 672cf4
fi
Packit Service 672cf4
AC_SUBST(INSERT__TYPEDEFS_FOR_GPGME_H)
Packit Service 672cf4
AM_SUBST_NOTMAKE(INSERT__TYPEDEFS_FOR_GPGME_H)
Packit Service 672cf4
AC_SUBST(API__OFF_T)
Packit Service 672cf4
AM_SUBST_NOTMAKE(API__OFF_T)
Packit Service 672cf4
AC_SUBST(API__SSIZE_T)
Packit Service 672cf4
AM_SUBST_NOTMAKE(API__SSIZE_T)
Packit Service 672cf4
Packit Service 672cf4
# Checks for compiler features.
Packit Service 672cf4
if test "$GCC" = yes; then
Packit Service 672cf4
    CFLAGS="$CFLAGS -Wall -Wcast-align -Wshadow -Wstrict-prototypes"
Packit Service 0ef63b
    CFLAGS="$CFLAGS -Wno-format-y2k"
Packit Service 0ef63b
Packit Service 0ef63b
    # If -Wno-missing-field-initializers is supported we can expect a
Packit Service 0ef63b
    # a larger set of warning options.
Packit Service 0ef63b
    AC_MSG_CHECKING([if gcc supports -Wno-missing-field-initializers])
Packit Service 0ef63b
    _gcc_cflags_save=$CFLAGS
Packit Service 0ef63b
    CFLAGS="-Wno-missing-field-initializers"
Packit Service 0ef63b
    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],_gcc_wopt=yes,_gcc_wopt=no)
Packit Service 0ef63b
    AC_MSG_RESULT($_gcc_wopt)
Packit Service 0ef63b
    CFLAGS=$_gcc_cflags_save;
Packit Service 0ef63b
    if test x"$_gcc_wopt" = xyes ; then
Packit Service 0ef63b
      CFLAGS="$CFLAGS -Wno-missing-field-initializers"
Packit Service 0ef63b
      CFLAGS="$CFLAGS -Wno-sign-compare"
Packit Service 0ef63b
      CFLAGS="$CFLAGS -Wno-format-zero-length"
Packit Service 0ef63b
      CFLAGS="$CFLAGS -Wno-format-truncation"
Packit Service 0ef63b
      CFLAGS="$CFLAGS -Wno-sizeof-pointer-div"
Packit Service 0ef63b
    fi
Packit Service 672cf4
    if test "$USE_MAINTAINER_MODE" = "yes"; then
Packit Service 672cf4
        if test x"$_gcc_wopt" = xyes ; then
Packit Service 672cf4
          CFLAGS="$CFLAGS -W -Wextra -Wbad-function-cast"
Packit Service 672cf4
          CFLAGS="$CFLAGS -Wwrite-strings"
Packit Service 672cf4
          CFLAGS="$CFLAGS -Wdeclaration-after-statement"
Packit Service 672cf4
        fi
Packit Service 0ef63b
        CFLAGS="$CFLAGS -Wformat -Wformat-security"
Packit Service 672cf4
        CXXFLAGS="$CXXFLAGS -Wall -Wextra -Wno-shadow"
Packit Service 672cf4
Packit Service 672cf4
        AC_MSG_CHECKING([if gcc supports -Wpointer-arith])
Packit Service 672cf4
        _gcc_cflags_save=$CFLAGS
Packit Service 672cf4
        CFLAGS="-Wpointer-arith"
Packit Service 672cf4
        AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],_gcc_wopt=yes,_gcc_wopt=no)
Packit Service 672cf4
        AC_MSG_RESULT($_gcc_wopt)
Packit Service 672cf4
        CFLAGS=$_gcc_cflags_save;
Packit Service 672cf4
        if test x"$_gcc_wopt" = xyes ; then
Packit Service 672cf4
          CFLAGS="$CFLAGS -Wpointer-arith"
Packit Service 672cf4
        fi
Packit Service 672cf4
    fi
Packit Service 672cf4
    if test "$have_w32_system" = yes; then
Packit Service 672cf4
       CFLAGS="$CFLAGS -mms-bitfields"
Packit Service 672cf4
    fi
Packit Service 672cf4
fi
Packit Service 672cf4
Packit Service 672cf4
# Only used for debugging, so no serious test needed (for actual
Packit Service 672cf4
# functionality you have to test libc as well, this only tests the
Packit Service 672cf4
# compiler).
Packit Service 672cf4
AC_CACHE_CHECK([for __thread],[gpgme_cv_tls_works],
Packit Service 672cf4
   AC_COMPILE_IFELSE([AC_LANG_PROGRAM([__thread int foo;])],
Packit Service 672cf4
                     gpgme_cv_tls_works=yes,gpgme_cv_tls_works=no))
Packit Service 672cf4
if test "$gpgme_cv_tls_works" = yes; then
Packit Service 672cf4
  AC_DEFINE(HAVE_TLS, [1], [Define if __thread is supported])
Packit Service 672cf4
fi
Packit Service 672cf4
Packit Service 672cf4
Packit Service 672cf4
# Checks for library functions.
Packit Service 672cf4
AC_MSG_NOTICE([checking for libraries])
Packit Service 672cf4
Packit Service 672cf4
AC_FUNC_FSEEKO
Packit Service 672cf4
Packit Service 672cf4
# Try to find a thread-safe version of ttyname().
Packit Service 672cf4
gnupg_REPLACE_TTYNAME_R
Packit Service 672cf4
if test "$ac_cv_func_ttyname_r" != yes; then
Packit Service 672cf4
  AC_MSG_WARN([
Packit Service 672cf4
***
Packit Service 672cf4
*** ttyname() is not thread-safe and ttyname_r() does not exist
Packit Service 672cf4
***])
Packit Service 672cf4
fi
Packit Service 672cf4
Packit Service 672cf4
# Try to find a thread-safe version of getenv().
Packit Service 672cf4
have_thread_safe_getenv=no
Packit Service 672cf4
jm_GLIBC21
Packit Service 0ef63b
if test $GLIBC21 = yes -o $have_w32_system = yes; then
Packit Service 672cf4
  have_thread_safe_getenv=yes
Packit Service 672cf4
fi
Packit Service 672cf4
if test $have_thread_safe_getenv = yes; then
Packit Service 672cf4
  AC_DEFINE(HAVE_THREAD_SAFE_GETENV, [1], [Define if getenv() is thread-safe])
Packit Service 672cf4
fi
Packit Service 672cf4
have_getenv_r=no
Packit Service 672cf4
AC_CHECK_FUNCS(getenv_r, have_getenv_r=yes)
Packit Service 672cf4
if test $have_getenv_r = no && test $have_thread_safe_getenv = no; then
Packit Service 672cf4
  AC_MSG_WARN([
Packit Service 672cf4
***
Packit Service 672cf4
*** getenv() is not thread-safe and getenv_r() does not exist
Packit Service 672cf4
***])
Packit Service 672cf4
fi
Packit Service 672cf4
Packit Service 672cf4
# For converting time strings to seconds since Epoch, we need the timegm
Packit Service 672cf4
# function.
Packit Service 672cf4
AC_CHECK_FUNCS(timegm)
Packit Service 672cf4
if test "$ac_cv_func_timegm" != yes; then
Packit Service 672cf4
  AC_MSG_WARN([
Packit Service 672cf4
***
Packit Service 672cf4
*** timegm() not available - a non-thread-safe kludge will be used
Packit Service 672cf4
*** and the TZ variable might be changed at runtime.
Packit Service 672cf4
***])
Packit Service 672cf4
fi
Packit Service 672cf4
Packit Service 672cf4
AC_CHECK_FUNCS(setlocale)
Packit Service 672cf4
Packit Service 672cf4
# Checking for libgpg-error.
Packit Service 672cf4
have_gpg_error=no
Packit Service 672cf4
AM_PATH_GPG_ERROR("$NEED_GPG_ERROR_VERSION",
Packit Service 672cf4
                  have_gpg_error=yes, have_gpg_error=no)
Packit Service 672cf4
AC_DEFINE(GPG_ERR_SOURCE_DEFAULT, GPG_ERR_SOURCE_GPGME,
Packit Service 672cf4
          [The default error source for GPGME.])
Packit Service 672cf4
Packit Service 672cf4
# And for libassuan.
Packit Service 672cf4
have_libassuan=no
Packit Service 672cf4
AM_PATH_LIBASSUAN("$NEED_LIBASSUAN_API:$NEED_LIBASSUAN_VERSION",
Packit Service 672cf4
                  have_libassuan=yes, have_libassuan=no)
Packit Service 672cf4
if test "$have_libassuan" = "yes"; then
Packit Service 672cf4
  AC_DEFINE_UNQUOTED(GPGME_LIBASSUAN_VERSION, "$libassuan_version",
Packit Service 672cf4
                     [version of the libassuan library])
Packit Service 672cf4
fi
Packit Service 672cf4
Packit Service 672cf4
Packit Service 672cf4
#
Packit Service 672cf4
# Other checks
Packit Service 672cf4
#
Packit Service 672cf4
Packit Service 672cf4
# Check for getgid etc
Packit Service 672cf4
AC_CHECK_FUNCS(getgid getegid closefrom)
Packit Service 672cf4
Packit Service 672cf4
Packit Service 672cf4
# Replacement functions.
Packit Service 672cf4
AC_REPLACE_FUNCS(stpcpy)
Packit Service 672cf4
AC_REPLACE_FUNCS(setenv)
Packit Service 672cf4
Packit Service 672cf4
# Assuan check for descriptor passing.
Packit Service 672cf4
AC_CHECK_MEMBER(struct cmsghdr.cmsg_len,
Packit Service 672cf4
                [supports_descriptor_passing=yes],
Packit Service 672cf4
                [supports_descriptor_passing=no
Packit Service 672cf4
                 AC_MSG_WARN([
Packit Service 672cf4
***
Packit Service 672cf4
*** Data structure for sending ancillary data missing.
Packit Service 672cf4
*** Descriptor passing won't work.
Packit Service 672cf4
***])],[
Packit Service 672cf4
#include <stdlib.h>
Packit Service 672cf4
#include <stddef.h>
Packit Service 672cf4
#include <stdio.h>
Packit Service 672cf4
#include <sys/types.h>
Packit Service 672cf4
#include <sys/socket.h>
Packit Service 672cf4
#include <sys/un.h>
Packit Service 672cf4
#if HAVE_SYS_UIO_H
Packit Service 672cf4
#include <sys/uio.h>
Packit Service 672cf4
#endif
Packit Service 672cf4
#include <unistd.h>
Packit Service 672cf4
       ])
Packit Service 672cf4
Packit Service 672cf4
use_descriptor_passing=yes
Packit Service 672cf4
AC_ARG_ENABLE(fd-passing,
Packit Service 672cf4
  AC_HELP_STRING([--disable-fd-passing], [do not use FD passing]),
Packit Service 672cf4
  use_descriptor_passing=$enableval)
Packit Service 672cf4
Packit Service 672cf4
if test "$supports_descriptor_passing" != "yes"; then
Packit Service 672cf4
  use_descriptor_passing=no
Packit Service 672cf4
fi
Packit Service 672cf4
Packit Service 672cf4
if test "$use_descriptor_passing" = "yes"; then
Packit Service 672cf4
AC_DEFINE(USE_DESCRIPTOR_PASSING,1,
Packit Service 672cf4
          [Defined if descriptor passing is enabled and supported])
Packit Service 672cf4
fi
Packit Service 672cf4
Packit Service 672cf4
AM_CONDITIONAL(USE_DESCRIPTOR_PASSING, test "$use_descriptor_passing" = "yes")
Packit Service 672cf4
Packit Service 672cf4
Packit Service 672cf4
uiserver=no
Packit Service 672cf4
if test "$use_descriptor_passing" = "yes" && test "$have_libassuan" = "yes"; then
Packit Service 672cf4
  uiserver=yes
Packit Service 672cf4
fi
Packit Service 672cf4
if test "$uiserver" != "no"; then
Packit Service 672cf4
  AC_DEFINE(ENABLE_UISERVER, 1,
Packit Service 672cf4
            [Defined if we are building with uiserver support.])
Packit Service 672cf4
fi
Packit Service 672cf4
AM_CONDITIONAL(HAVE_UISERVER, test "$uiserver" != "no")
Packit Service 672cf4
Packit Service 672cf4
Packit Service 672cf4
# Option --disable-linux-getdents
Packit Service 672cf4
#
Packit Service 672cf4
# By default we use SYS_getdents on Linux to optimize fd closing
Packit Service 672cf4
# before an exec.  This option allows to switch this optimization off.
Packit Service 672cf4
use_linux_getdents=yes
Packit Service 672cf4
AC_ARG_ENABLE(linux-getdents,
Packit Service 672cf4
              AC_HELP_STRING([--disable-linux-getdents],
Packit Service 672cf4
                             [do not use SYS_getdents on Linux]),
Packit Service 672cf4
              use_linux_getdents=$enableval)
Packit Service 672cf4
if test "$use_linux_getdents" = "yes"; then
Packit Service 672cf4
    case "${host}" in
Packit Service 672cf4
        *-*-linux*)
Packit Service 672cf4
           AC_DEFINE(USE_LINUX_GETDENTS,1,
Packit Service 672cf4
                     [Defined if SYS_getdents can be used on Linux])
Packit Service 672cf4
           ;;
Packit Service 672cf4
    esac
Packit Service 672cf4
fi
Packit Service 672cf4
Packit Service 672cf4
Packit Service 672cf4
#
Packit Service 672cf4
# Add a few constants to help porting to W32
Packit Service 672cf4
#
Packit Service 672cf4
AH_VERBATIM([SEPCONSTANTS],
Packit Service 672cf4
[
Packit Service 672cf4
/* Separators as used in $PATH and file name.  */
Packit Service 672cf4
#ifdef HAVE_DOSISH_SYSTEM
Packit Service 672cf4
#define PATHSEP_C ';'
Packit Service 672cf4
#define DIRSEP_C '\\'
Packit Service 672cf4
#define DIRSEP_S "\\"
Packit Service 672cf4
#else
Packit Service 672cf4
#define PATHSEP_C ':'
Packit Service 672cf4
#define DIRSEP_C '/'
Packit Service 672cf4
#define DIRSEP_S "/"
Packit Service 672cf4
#endif
Packit Service 672cf4
])
Packit Service 672cf4
Packit Service 672cf4
AH_BOTTOM([
Packit Service 672cf4
/* Definition of GCC specific attributes.  */
Packit Service 672cf4
#if __GNUC__ > 2
Packit Service 672cf4
# define GPGME_GCC_A_PURE  __attribute__ ((__pure__))
Packit Service 672cf4
#else
Packit Service 672cf4
# define GPGME_GCC_A_PURE
Packit Service 672cf4
#endif
Packit Service 672cf4
Packit Service 672cf4
/* Under WindowsCE we need gpg-error's strerror macro.  */
Packit Service 672cf4
#define GPG_ERR_ENABLE_ERRNO_MACROS 1
Packit Service 672cf4
Packit Service 672cf4
#define CRIGHTBLURB "Copyright (C) 2000 Werner Koch\n" \
Packit Service 0ef63b
                    "Copyright (C) 2001--2018 g10 Code GmbH\n"
Packit Service 672cf4
])
Packit Service 672cf4
Packit Service 672cf4
Packit Service 672cf4
# Substitution used for gpgme-config
Packit Service 672cf4
GPGME_CONFIG_LIBS="-lgpgme"
Packit Service 672cf4
GPGME_CONFIG_CFLAGS=""
Packit Service 672cf4
GPGME_CONFIG_HOST="$host"
Packit Service 672cf4
GPGME_CONFIG_AVAIL_LANG="$enabled_languages"
Packit Service 672cf4
AC_SUBST(GPGME_CONFIG_API_VERSION)
Packit Service 672cf4
AC_SUBST(GPGME_CONFIG_LIBS)
Packit Service 672cf4
AC_SUBST(GPGME_CONFIG_CFLAGS)
Packit Service 672cf4
AC_SUBST(GPGME_CONFIG_HOST)
Packit Service 672cf4
AC_SUBST(GPGME_CONFIG_AVAIL_LANG)
Packit Service 672cf4
Packit Service 672cf4
# Frob'da Variables
Packit Service 672cf4
LTLIBOBJS=`echo "$LIB@&t@OBJS" |
Packit Service 672cf4
           sed 's,\.[[^.]]* ,.lo ,g;s,\.[[^.]]*$,.lo,'`
Packit Service 672cf4
AC_SUBST(LTLIBOBJS)
Packit Service 672cf4
Packit Service 672cf4
# Some checks for gpgme-tool
Packit Service 672cf4
# Done at top: AC_CHECK_HEADER([argp.h])
Packit Service 672cf4
AC_CHECK_TYPES([error_t], [],
Packit Service 672cf4
   [AC_DEFINE([error_t], [int],
Packit Service 672cf4
   [Define to a type to use for `error_t' if it is not otherwise available.])],
Packit Service 672cf4
   [#include <errno.h>])
Packit Service 672cf4
Packit Service 672cf4
Packit Service 672cf4
# A substitution to set generated files in a Emacs buffer to read-only.
Packit Service 672cf4
AC_SUBST(emacs_local_vars_begin, [['Local][ ][Variables:']])
Packit Service 672cf4
AC_SUBST(emacs_local_vars_read_only, ['buffer-read-only: t'])
Packit Service 672cf4
AC_SUBST(emacs_local_vars_end, ['End:'])
Packit Service 672cf4
Packit Service 672cf4
# Last check.
Packit Service 672cf4
die=no
Packit Service 672cf4
if test "$have_gpg_error" = "no"; then
Packit Service 672cf4
   die=yes
Packit Service 672cf4
   AC_MSG_NOTICE([[
Packit Service 672cf4
***
Packit Service 672cf4
*** You need libgpg-error to build this program.
Packit Service 672cf4
**  This library is for example available at
Packit Service 0ef63b
***   https://www.gnupg.org/ftp/gcrypt/libgpg-error/
Packit Service 672cf4
*** (at least version $NEED_GPG_ERROR_VERSION is required.)
Packit Service 672cf4
***]])
Packit Service 672cf4
fi
Packit Service 672cf4
if test "$have_libassuan" = "no"; then
Packit Service 672cf4
   die=yes
Packit Service 672cf4
   AC_MSG_NOTICE([[
Packit Service 672cf4
***
Packit Service 672cf4
*** You need libassuan to build this program.
Packit Service 672cf4
*** This library is for example available at
Packit Service 0ef63b
***   https://www.gnupg.org/ftp/gcrypt/libassuan/
Packit Service 672cf4
*** (at least version $NEED_LIBASSUAN_VERSION (API $NEED_LIBASSUAN_API) is required).
Packit Service 672cf4
***]])
Packit Service 672cf4
fi
Packit Service 672cf4
Packit Service 672cf4
if test "$die" = "yes"; then
Packit Service 672cf4
    AC_MSG_ERROR([[
Packit Service 672cf4
***
Packit Service 672cf4
*** Required libraries not found. Please consult the above messages
Packit Service 672cf4
*** and install them before running configure again.
Packit Service 672cf4
***]])
Packit Service 672cf4
fi
Packit Service 672cf4
Packit Service 672cf4
Packit Service 672cf4
#
Packit Service 672cf4
# Create config files
Packit Service 672cf4
Packit Service 672cf4
AC_CONFIG_FILES(Makefile src/Makefile
Packit Service 672cf4
		tests/Makefile
Packit Service 672cf4
                tests/gpg/Makefile
Packit Service 672cf4
                tests/gpgsm/Makefile
Packit Service 672cf4
                tests/opassuan/Makefile
Packit Service 0ef63b
                tests/json/Makefile
Packit Service 672cf4
		doc/Makefile
Packit Service 672cf4
                src/versioninfo.rc
Packit Service 0ef63b
                src/gpgme.pc
Packit Service 0ef63b
                src/gpgme-glib.pc
Packit Service 672cf4
                src/gpgme.h)
Packit Service 672cf4
AC_CONFIG_FILES(src/gpgme-config, chmod +x src/gpgme-config)
Packit Service 672cf4
AC_CONFIG_FILES(lang/cpp/Makefile lang/cpp/src/Makefile)
Packit Service 0ef63b
AC_CONFIG_FILES(lang/cpp/tests/Makefile)
Packit Service 672cf4
AC_CONFIG_FILES(lang/cpp/src/GpgmeppConfig-w32.cmake.in)
Packit Service 672cf4
AC_CONFIG_FILES(lang/cpp/src/GpgmeppConfig.cmake.in)
Packit Service 672cf4
AC_CONFIG_FILES(lang/cpp/src/GpgmeppConfigVersion.cmake)
Packit Service 672cf4
AC_CONFIG_FILES(lang/cpp/src/gpgmepp_version.h)
Packit Service 672cf4
AC_CONFIG_FILES(lang/qt/Makefile lang/qt/src/Makefile)
Packit Service 672cf4
AC_CONFIG_FILES(lang/qt/src/QGpgmeConfig-w32.cmake.in)
Packit Service 672cf4
AC_CONFIG_FILES(lang/qt/src/QGpgmeConfig.cmake.in)
Packit Service 672cf4
AC_CONFIG_FILES(lang/qt/src/QGpgmeConfigVersion.cmake)
Packit Service 672cf4
AC_CONFIG_FILES(lang/qt/tests/Makefile)
Packit Service 672cf4
AC_CONFIG_FILES(lang/qt/src/qgpgme_version.h)
Packit Service 672cf4
AC_CONFIG_FILES([lang/Makefile lang/cl/Makefile lang/cl/gpgme.asd])
Packit Service 672cf4
AM_COND_IF([HAVE_DOXYGEN], [AC_CONFIG_FILES([lang/qt/doc/Doxyfile])])
Packit Service 0ef63b
AC_CONFIG_FILES([lang/js/Makefile lang/js/src/Makefile
Packit Service 0ef63b
                 lang/js/BrowserTestExtension/Makefile
Packit Service 0ef63b
                 lang/js/DemoExtension/Makefile])
Packit Service 672cf4
AC_CONFIG_FILES(lang/qt/doc/Makefile)
Packit Service 672cf4
AC_CONFIG_FILES([lang/python/Makefile
Packit Service 672cf4
		 lang/python/version.py
Packit Service 0ef63b
		 lang/python/tests/Makefile
Packit Service 0ef63b
		 lang/python/src/Makefile
Packit Service 0ef63b
		 lang/python/examples/Makefile
Packit Service 0ef63b
		 lang/python/doc/Makefile])
Packit Service 672cf4
AC_CONFIG_FILES([lang/python/setup.py], [chmod a+x lang/python/setup.py])
Packit Service 672cf4
AC_OUTPUT
Packit Service 672cf4
Packit Service 672cf4
echo "
Packit Service 672cf4
        GPGME v${VERSION} has been configured as follows:
Packit Service 672cf4
Packit Service 672cf4
        Revision:          mym4_revision  (mym4_revision_dec)
Packit Service 672cf4
        Platform:          $host
Packit Service 672cf4
Packit Service 672cf4
        UI Server:         $uiserver
Packit Service 672cf4
        FD Passing:        $use_descriptor_passing
Packit Service 672cf4
Packit Service 672cf4
        Language bindings: ${enabled_languages_v:-$enabled_languages}
Packit Service 672cf4
"
Packit Service 672cf4
if test "x${gpg_config_script_warn}" != x; then
Packit Service 672cf4
cat <
Packit Service 672cf4
        Mismatches between the target platform and the to
Packit Service 672cf4
        be used libraries have been been detected for:
Packit Service 672cf4
         ${gpg_config_script_warn}
Packit Service 672cf4
        Please check above for warning messages.
Packit Service 672cf4
Packit Service 672cf4
G10EOF
Packit Service 672cf4
fi