Blame configure.ac

Packit 3c2767
# configure.ac - for libassuan
Packit 3c2767
# Copyright (C) 2001, 2002, 2003, 2006, 2007, 2009,
Packit 3c2767
#               2011, 2012, 2013 Free Software Foundation, Inc.
Packit 3c2767
# Copyright (C) 2013, 2014, 2015  g10 Code GmbH
Packit 3c2767
#
Packit 3c2767
# This file is part of Assuan.
Packit 3c2767
#
Packit 3c2767
# Assuan is free software; you can redistribute it and/or modify it
Packit 3c2767
# under the terms of the GNU Lesser General Public License as
Packit 3c2767
# published by the Free Software Foundation; either version 2.1 of
Packit 3c2767
# the License, or (at your option) any later version.
Packit 3c2767
#
Packit 3c2767
# Assuan is distributed in the hope that it will be useful, but
Packit 3c2767
# WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 3c2767
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit 3c2767
# Lesser General Public License for more details.
Packit 3c2767
#
Packit 3c2767
# You should have received a copy of the GNU Lesser General Public
Packit 3c2767
# License along with this program; if not, see <http://www.gnu.org/licenses/>.
Packit 3c2767
# SPDX-License-Identifier: LGPL-2.1+
Packit 3c2767
Packit 3c2767
# Process this file with autoconf to produce a configure script.
Packit 3c2767
Packit 3c2767
Packit 3c2767
AC_PREREQ(2.61)
Packit 3c2767
min_automake_version="1.14"
Packit 3c2767
Packit 3c2767
# To build a release you need to create a tag with the version number
Packit 3c2767
# (git tag -s libassuan-n.m.k) and run "./autogen.sh --force".  Please
Packit 3c2767
# bump the version number immediately after the release and do another
Packit 3c2767
# commit and push so that the git magic is able to work.  See below
Packit 3c2767
# for the LT versions.
Packit 3c2767
m4_define([mym4_package],[libassuan])
Packit 3c2767
m4_define([mym4_major], [2])
Packit 3c2767
m4_define([mym4_minor], [5])
Packit 3c2767
m4_define([mym4_micro], [1])
Packit 3c2767
Packit 3c2767
# To start a new development series, i.e a new major or minor number
Packit 3c2767
# you need to mark an arbitrary commit before the first beta release
Packit 3c2767
# with an annotated tag.  For example a 2.1 branch starts off with
Packit 3c2767
# the tag "foo-2.1-base".  This is used as the base for counting
Packit 3c2767
# beta numbers before the first release of a series.
Packit 3c2767
Packit 3c2767
# Below is m4 magic to extract and compute the git revision number,
Packit 3c2767
# the decimalized short revision number, a beta version string and a
Packit 3c2767
# flag indicating a development version (mym4_isbeta).  Note that the
Packit 3c2767
# m4 processing is done by autoconf and not during the configure run.
Packit 3c2767
m4_define([mym4_verslist], m4_split(m4_esyscmd([./autogen.sh --find-version] \
Packit 3c2767
                           mym4_package mym4_major mym4_minor mym4_micro),[:]))
Packit 3c2767
m4_define([mym4_isbeta],       m4_argn(2, mym4_verslist))
Packit 3c2767
m4_define([mym4_version],      m4_argn(4, mym4_verslist))
Packit 3c2767
m4_define([mym4_revision],     m4_argn(7, mym4_verslist))
Packit 3c2767
m4_define([mym4_revision_dec], m4_argn(8, mym4_verslist))
Packit 3c2767
m4_esyscmd([echo ]mym4_version[>VERSION])
Packit 3c2767
Packit 3c2767
AC_INIT([mym4_package],[mym4_version], [https://bugs.gnupg.org])
Packit 3c2767
Packit 3c2767
# LT Version numbers, remember to change them just *before* a release.
Packit 3c2767
#   (Code changed:			REVISION++)
Packit 3c2767
#   (Interfaces added/removed/changed:	CURRENT++, REVISION=0)
Packit 3c2767
#   (Interfaces added:			AGE++)
Packit 3c2767
#   (Interfaces removed/changed:	AGE=0)
Packit 3c2767
#
Packit 3c2767
LIBASSUAN_LT_CURRENT=8
Packit 3c2767
LIBASSUAN_LT_AGE=8
Packit 3c2767
LIBASSUAN_LT_REVISION=1
Packit 3c2767
Packit 3c2767
# If the API is changed in an incompatible way: increment the next counter.
Packit 3c2767
LIBASSUAN_CONFIG_API_VERSION=2
Packit 3c2767
##############################################
Packit 3c2767
Packit 3c2767
AC_SUBST(LIBASSUAN_LT_CURRENT)
Packit 3c2767
AC_SUBST(LIBASSUAN_LT_AGE)
Packit 3c2767
AC_SUBST(LIBASSUAN_LT_REVISION)
Packit 3c2767
Packit 3c2767
PACKAGE=$PACKAGE_NAME
Packit 3c2767
VERSION=$PACKAGE_VERSION
Packit 3c2767
Packit 3c2767
AC_CONFIG_AUX_DIR([build-aux])
Packit 3c2767
AM_INIT_AUTOMAKE([serial-tests dist-bzip2 no-dist-gzip])
Packit 3c2767
AM_MAINTAINER_MODE
Packit 3c2767
AC_CONFIG_SRCDIR(src/assuan.h.in)
Packit 3c2767
AC_CONFIG_MACRO_DIR(m4)
Packit 3c2767
AM_CONFIG_HEADER(config.h)
Packit 3c2767
AC_CANONICAL_HOST
Packit 3c2767
AM_SILENT_RULES
Packit 3c2767
AB_INIT
Packit 3c2767
Packit 3c2767
AC_GNU_SOURCE
Packit 3c2767
Packit 3c2767
Packit 3c2767
AC_SUBST(PACKAGE)
Packit 3c2767
AC_SUBST(VERSION)
Packit 3c2767
AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of this package])
Packit 3c2767
AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version of this package])
Packit 3c2767
AC_DEFINE_UNQUOTED(PACKAGE_BUGREPORT, "$PACKAGE_BUGREPORT",[Bug report address])
Packit 3c2767
VERSION_NUMBER=m4_esyscmd(printf "0x%02x%02x%02x" mym4_major \
Packit 3c2767
                          mym4_minor mym4_micro)
Packit 3c2767
AC_SUBST(VERSION_NUMBER)
Packit 3c2767
Packit 3c2767
Packit 3c2767
# Don't default to build static libs.
Packit 3c2767
LT_PREREQ([2.2.6])
Packit 3c2767
LT_INIT([win32-dll disable-static])
Packit 3c2767
LT_LANG([Windows Resource])
Packit 3c2767
Packit 3c2767
# For now we hardcode the use of version scripts.  It would be better
Packit 3c2767
# to write a test for this or even implement this within libtool.
Packit 3c2767
have_ld_version_script=no
Packit 3c2767
check_descriptor_passing=yes
Packit 3c2767
case "${host}" in
Packit 3c2767
    *-*-cygwin*)
Packit 3c2767
        check_descriptor_passing=no
Packit 3c2767
        ;;
Packit 3c2767
    *-*-linux*)
Packit 3c2767
        have_ld_version_script=yes
Packit 3c2767
        ;;
Packit 3c2767
    *-*-gnu*)
Packit 3c2767
        have_ld_version_script=yes
Packit 3c2767
        ;;
Packit 3c2767
    *-apple-darwin*)
Packit 3c2767
        AC_DEFINE(_XOPEN_SOURCE, 500, Activate POSIX interface on MacOS X)
Packit 3c2767
        AC_DEFINE(_DARWIN_C_SOURCE, 900000L,
Packit 3c2767
                  Expose all libc features (__DARWIN_C_FULL))
Packit 3c2767
        ;;
Packit 3c2767
esac
Packit 3c2767
Packit 3c2767
AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, test "$have_ld_version_script" = "yes")
Packit 3c2767
Packit 3c2767
AH_TOP([
Packit 3c2767
#ifndef _ASSUAN_CONFIG_H_INCLUDED
Packit 3c2767
#define _ASSUAN_CONFIG_H_INCLUDED
Packit 3c2767
Packit 3c2767
/* Enable gpg-error's strerror macro under W32CE.  */
Packit 3c2767
#define GPG_ERR_ENABLE_ERRNO_MACROS 1
Packit 3c2767
Packit 3c2767
/* Provide the es_ macro for estream.  */
Packit 3c2767
#define GPGRT_ENABLE_ES_MACROS 1
Packit 3c2767
Packit 3c2767
])
Packit 3c2767
Packit 3c2767
AH_BOTTOM([
Packit 3c2767
Packit 3c2767
#endif /*_ASSUAN_CONFIG_H_INCLUDED*/
Packit 3c2767
])
Packit 3c2767
Packit 3c2767
Packit 3c2767
# Checks for programs.
Packit 3c2767
missing_dir=`cd $ac_aux_dir && pwd`
Packit 3c2767
AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
Packit 3c2767
AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
Packit 3c2767
AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
Packit 3c2767
AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
Packit 3c2767
AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
Packit 3c2767
AC_PROG_AWK
Packit 3c2767
AC_PROG_CC
Packit 3c2767
AC_PROG_CPP
Packit 3c2767
AM_PROG_CC_C_O
Packit 3c2767
if test "x$ac_cv_prog_cc_c89" = "xno" ; then
Packit 3c2767
  AC_MSG_ERROR([[No C-89 compiler found]])
Packit 3c2767
fi
Packit 3c2767
AC_PROG_INSTALL
Packit 3c2767
AC_PROG_LN_S
Packit 3c2767
AC_PROG_MAKE_SET
Packit 3c2767
#AC_ARG_PROGRAM
Packit 3c2767
Packit 3c2767
# We need to compile and run a program on the build machine.  A
Packit 3c2767
# comment in libgpg-error says that the AC_PROG_CC_FOR_BUILD macro in
Packit 3c2767
# the AC archive is broken for autoconf 2.57.  Given that there is no
Packit 3c2767
# newer version of that macro, we assume that it is also broken for
Packit 3c2767
# autoconf 2.61 and thus we use a simple but usually sufficient
Packit 3c2767
# approach.
Packit 3c2767
AC_MSG_CHECKING(for cc for build)
Packit 3c2767
if test "$cross_compiling" = "yes"; then
Packit 3c2767
  CC_FOR_BUILD="${CC_FOR_BUILD-cc}"
Packit 3c2767
else
Packit 3c2767
  CC_FOR_BUILD="${CC_FOR_BUILD-$CC}"
Packit 3c2767
fi
Packit 3c2767
AC_MSG_RESULT($CC_FOR_BUILD)
Packit 3c2767
AC_ARG_VAR(CC_FOR_BUILD,[build system C compiler])
Packit 3c2767
Packit 3c2767
Packit 3c2767
if test "$GCC" = yes; then
Packit 3c2767
    CFLAGS="$CFLAGS -Wall -Wcast-align -Wshadow -Wstrict-prototypes"
Packit 3c2767
Packit 3c2767
    AC_MSG_CHECKING([if gcc supports -Wpointer-arith])
Packit 3c2767
    _gcc_cflags_save=$CFLAGS
Packit 3c2767
    CFLAGS="-Wpointer-arith"
Packit 3c2767
    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],_gcc_wopt=yes,_gcc_wopt=no)
Packit 3c2767
    AC_MSG_RESULT($_gcc_wopt)
Packit 3c2767
    CFLAGS=$_gcc_cflags_save;
Packit 3c2767
    if test x"$_gcc_wopt" = xyes ; then
Packit 3c2767
       CFLAGS="$CFLAGS -Wpointer-arith"
Packit 3c2767
    fi
Packit 3c2767
fi
Packit 3c2767
Packit 3c2767
Packit 3c2767
#
Packit 3c2767
# Options depending on the host OS.
Packit 3c2767
#
Packit 3c2767
have_dosish_system=no
Packit 3c2767
have_w32_system=no
Packit 3c2767
have_w64_system=no
Packit 3c2767
have_w32ce_system=no
Packit 3c2767
case "${host}" in
Packit 3c2767
    *-linux*)
Packit 3c2767
        if test "$GCC" = yes; then
Packit 3c2767
          CFLAGS="$CFLAGS -fPIC -DPIC"
Packit 3c2767
        fi
Packit 3c2767
        ;;
Packit 3c2767
    x86_64-*mingw32*)
Packit 3c2767
        have_dosish_system=yes
Packit 3c2767
        have_w32_system=yes
Packit 3c2767
        have_w64_system=yes
Packit 3c2767
        ;;
Packit 3c2767
    *-mingw32ce*)
Packit 3c2767
        have_dosish_system=yes
Packit 3c2767
        have_w32_system=yes
Packit 3c2767
        have_w32ce_system=yes
Packit 3c2767
        ;;
Packit 3c2767
    *-mingw32*)
Packit 3c2767
        have_dosish_system=yes
Packit 3c2767
        have_w32_system=yes
Packit 3c2767
        ;;
Packit 3c2767
    *-solaris*)
Packit 3c2767
        AC_DEFINE(_XOPEN_SOURCE, 500, Activate extensions on Solaris)
Packit 3c2767
        AC_DEFINE(_XOPEN_SOURCE_EXTENDED, 1, Activate extensions on Solaris)
Packit 3c2767
        AC_DEFINE(__EXTENSIONS__, 1, Activate extensions on Solaris)
Packit 3c2767
        ;;
Packit 3c2767
esac
Packit 3c2767
Packit 3c2767
if test "$have_dosish_system" = yes; then
Packit 3c2767
   AC_DEFINE(HAVE_DOSISH_SYSTEM,1,
Packit 3c2767
             [Defined if we run on some of the PCDOS like systems
Packit 3c2767
              (DOS, Windoze. OS/2) with special properties like
Packit 3c2767
              no file modes])
Packit 3c2767
fi
Packit 3c2767
Packit 3c2767
if test "$have_w32_system" = yes; then
Packit 3c2767
    AC_DEFINE(HAVE_W32_SYSTEM,1,[Defined if we run on a W32 API based system])
Packit 3c2767
    if test "$have_w64_system" = yes; then
Packit 3c2767
      AC_DEFINE(HAVE_W64_SYSTEM,1,
Packit 3c2767
                [Defined if we run on a 64 bit W32 API based system])
Packit 3c2767
    fi
Packit 3c2767
    if test "$have_w32ce_system" = yes; then
Packit 3c2767
       AC_DEFINE(HAVE_W32CE_SYSTEM,1,[Defined if we run on WindowsCE])
Packit 3c2767
    fi
Packit 3c2767
fi
Packit 3c2767
AM_CONDITIONAL(HAVE_W32_SYSTEM, test "$have_w32_system" = yes)
Packit 3c2767
AM_CONDITIONAL(HAVE_W32CE_SYSTEM, test "$have_w32ce_system" = yes)
Packit 3c2767
AM_CONDITIONAL(HAVE_W64_SYSTEM, test "$have_w64_system" = yes)
Packit 3c2767
Packit 3c2767
Packit 3c2767
#
Packit 3c2767
# Provide information about the build.
Packit 3c2767
#
Packit 3c2767
BUILD_REVISION="mym4_revision"
Packit 3c2767
AC_SUBST(BUILD_REVISION)
Packit 3c2767
AC_DEFINE_UNQUOTED(BUILD_REVISION, "$BUILD_REVISION",
Packit 3c2767
                   [GIT commit id revision used to build this package])
Packit 3c2767
Packit 3c2767
changequote(,)dnl
Packit 3c2767
BUILD_FILEVERSION=`echo "$VERSION" | sed 's/\([0-9.]*\).*/\1./;s/\./,/g'`
Packit 3c2767
changequote([,])dnl
Packit 3c2767
BUILD_FILEVERSION="${BUILD_FILEVERSION}mym4_revision_dec"
Packit 3c2767
AC_SUBST(BUILD_FILEVERSION)
Packit 3c2767
Packit 3c2767
AC_ARG_ENABLE([build-timestamp],
Packit 3c2767
  AC_HELP_STRING([--enable-build-timestamp],
Packit 3c2767
                 [set an explicit build timestamp for reproducibility.
Packit 3c2767
                  (default is the current time in ISO-8601 format)]),
Packit 3c2767
     [if test "$enableval" = "yes"; then
Packit 3c2767
        BUILD_TIMESTAMP=`date -u +%Y-%m-%dT%H:%M+0000 2>/dev/null || date`
Packit 3c2767
      else
Packit 3c2767
        BUILD_TIMESTAMP="$enableval"
Packit 3c2767
      fi],
Packit 3c2767
     [BUILD_TIMESTAMP="<none>"])
Packit 3c2767
AC_SUBST(BUILD_TIMESTAMP)
Packit 3c2767
AC_DEFINE_UNQUOTED(BUILD_TIMESTAMP, "$BUILD_TIMESTAMP",
Packit 3c2767
                   [The time this package was configured for a build])
Packit 3c2767
Packit 3c2767
Packit 3c2767
Packit 3c2767
#
Packit 3c2767
# Check for network libraries.  They are needed for tests.
Packit 3c2767
#
Packit 3c2767
AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt,
Packit 3c2767
        [NETLIBS="-lsocket $NETLIBS"]))
Packit 3c2767
AC_SUBST(NETLIBS)
Packit 3c2767
Packit 3c2767
if test "$have_w32_system" = yes; then
Packit 3c2767
   if test "$have_w32ce_system" = yes; then
Packit 3c2767
     NETLIBS="-lws2 $NETLIBS"
Packit 3c2767
   else
Packit 3c2767
     # FIXME: Check why we need to use ws2_32 and document that.
Packit 3c2767
     NETLIBS="-lws2_32 $NETLIBS"
Packit 3c2767
   fi
Packit 3c2767
fi
Packit 3c2767
Packit 3c2767
#
Packit 3c2767
# Provide info for src/libassuan-config.in
Packit 3c2767
#
Packit 3c2767
LIBASSUAN_CONFIG_LIB="-lassuan"
Packit 3c2767
LIBASSUAN_CONFIG_CFLAGS=""
Packit 3c2767
LIBASSUAN_CONFIG_HOST="$host"
Packit 3c2767
LIBASSUAN_CONFIG_EXTRA_LIBS=
Packit 3c2767
if test x"$NETLIBS" != x; then
Packit 3c2767
  LIBASSUAN_CONFIG_EXTRA_LIBS="$LIBASSUAN_CONFIG_EXTRA_LIBS $NETLIBS"
Packit 3c2767
fi
Packit 3c2767
AC_SUBST(LIBASSUAN_CONFIG_LIB)
Packit 3c2767
AC_SUBST(LIBASSUAN_CONFIG_CFLAGS)
Packit 3c2767
AC_SUBST(LIBASSUAN_CONFIG_HOST)
Packit 3c2767
AC_SUBST(LIBASSUAN_CONFIG_API_VERSION)
Packit 3c2767
AC_SUBST(LIBASSUAN_CONFIG_EXTRA_LIBS)
Packit 3c2767
Packit 3c2767
#
Packit 3c2767
# Checks for header files.
Packit 3c2767
#
Packit 3c2767
AC_HEADER_STDC
Packit 3c2767
AC_CHECK_HEADERS([string.h locale.h sys/uio.h stdint.h inttypes.h \
Packit 3c2767
                  sys/types.h sys/stat.h unistd.h sys/time.h fcntl.h \
Packit 3c2767
                  sys/select.h ])
Packit 3c2767
AC_TYPE_UINTPTR_T
Packit 3c2767
AC_TYPE_UINT16_T
Packit 3c2767
Packit 3c2767
#
Packit 3c2767
# Checks for typedefs, structures, and compiler characteristics.
Packit 3c2767
#
Packit 3c2767
AC_C_CONST
Packit 3c2767
AC_C_INLINE
Packit 3c2767
AC_TYPE_SIZE_T
Packit 3c2767
AC_TYPE_SIGNAL
Packit 3c2767
AC_DECL_SYS_SIGLIST
Packit 3c2767
Packit 3c2767
gl_HEADER_SYS_SOCKET
Packit 3c2767
gl_TYPE_SOCKLEN_T
Packit 3c2767
Packit 3c2767
if test $check_descriptor_passing != yes; then
Packit 3c2767
    use_descriptor_passing=no
Packit 3c2767
else
Packit 3c2767
    AC_CHECK_MEMBER(struct cmsghdr.cmsg_len,
Packit 3c2767
                    [use_descriptor_passing=yes],
Packit 3c2767
                    [use_descriptor_passing=no
Packit 3c2767
                     AC_MSG_WARN([
Packit 3c2767
***
Packit 3c2767
*** Data structure for sending ancillary data missing.
Packit 3c2767
*** Descriptor passing won't work.
Packit 3c2767
***])],[
Packit 3c2767
#include <stdlib.h>
Packit 3c2767
#include <stddef.h>
Packit 3c2767
#include <stdio.h>
Packit 3c2767
#include <sys/types.h>
Packit 3c2767
#include <sys/socket.h>
Packit 3c2767
#include <sys/un.h>
Packit 3c2767
#if HAVE_SYS_UIO_H
Packit 3c2767
#include <sys/uio.h>
Packit 3c2767
#endif
Packit 3c2767
#include <unistd.h>
Packit 3c2767
       ])
Packit 3c2767
fi
Packit 3c2767
if test "$use_descriptor_passing" = "yes"; then
Packit 3c2767
 AC_DEFINE(USE_DESCRIPTOR_PASSING, 1,
Packit 3c2767
            [Defined if descriptor passing is supported])
Packit 3c2767
fi
Packit 3c2767
AM_CONDITIONAL(USE_DESCRIPTOR_PASSING, test "$use_descriptor_passing" = "yes")
Packit 3c2767
Packit 3c2767
Packit 3c2767
# Checking for libgpg-error.
Packit 3c2767
AM_PATH_GPG_ERROR(1.17,, AC_MSG_ERROR([libgpg-error was not found]))
Packit 3c2767
Packit 3c2767
#
Packit 3c2767
# Checks for library functions.
Packit 3c2767
#
Packit 3c2767
AC_CHECK_FUNCS([flockfile funlockfile inet_pton stat getaddrinfo \
Packit 3c2767
                getrlimit ])
Packit 3c2767
Packit 3c2767
# If we didn't find inet_pton, it might be in -lsocket (which might
Packit 3c2767
# require -lnsl)
Packit 3c2767
if test X"$ac_cv_func_inet_pton" != X"yes" ; then
Packit 3c2767
    AC_SEARCH_LIBS([inet_pton],[socket],[],[],[-lnsl])
Packit 3c2767
    if test X"$ac_cv_search_inet_pton" != X"no" ; then
Packit 3c2767
        AC_DEFINE([HAVE_INET_PTON],1,[Define to 1 if you have `inet_pton'.])
Packit 3c2767
    fi
Packit 3c2767
fi
Packit 3c2767
Packit 3c2767
Packit 3c2767
# On some systems (e.g. Solaris) nanosleep requires linking to librl.
Packit 3c2767
# Given that we use nanosleep only as an optimization over a select
Packit 3c2767
# based wait function we want it only if it is available in libc.
Packit 3c2767
_save_libs="$LIBS"
Packit 3c2767
AC_SEARCH_LIBS([nanosleep], [],
Packit 3c2767
               [AC_DEFINE(HAVE_NANOSLEEP,1,
Packit 3c2767
                [Define to 1 if you have the `nanosleep' function in libc.])])
Packit 3c2767
LIBS="$_save_libs"
Packit 3c2767
Packit 3c2767
Packit 3c2767
# Check for funopen
Packit 3c2767
AC_CHECK_FUNCS(funopen)
Packit 3c2767
if test $ac_cv_func_funopen != yes; then
Packit 3c2767
    # No funopen but we can implement that in terms of fopencookie.
Packit 3c2767
    AC_CHECK_FUNCS(fopencookie)
Packit 3c2767
    if test $ac_cv_func_fopencookie = yes; then
Packit 3c2767
        AC_LIBOBJ([funopen])
Packit 3c2767
    else
Packit 3c2767
        AC_MSG_WARN([
Packit 3c2767
***
Packit 3c2767
*** No implementation of fopencookie or funopen available.
Packit 3c2767
*** The assuan_get_data_fp function won't work; see the
Packit 3c2767
*** manual for details.  GnuPG does not require this feature.
Packit 3c2767
***])
Packit 3c2767
    fi
Packit 3c2767
fi
Packit 3c2767
Packit 3c2767
Packit 3c2767
AC_REPLACE_FUNCS(isascii)
Packit 3c2767
AC_REPLACE_FUNCS(putc_unlocked)
Packit 3c2767
AC_REPLACE_FUNCS(memrchr)
Packit 3c2767
AC_REPLACE_FUNCS(stpcpy)
Packit 3c2767
AC_CHECK_HEADERS(unistd.h)
Packit 3c2767
AC_REPLACE_FUNCS(setenv)
Packit 3c2767
Packit 3c2767
Packit 3c2767
#
Packit 3c2767
# Check for the getsockopt SO_PEERCRED
Packit 3c2767
#
Packit 3c2767
AC_MSG_CHECKING(for SO_PEERCRED)
Packit 3c2767
AC_CACHE_VAL(assuan_cv_sys_so_peercred,
Packit 3c2767
      [AC_TRY_COMPILE([#include <sys/socket.h>],
Packit 3c2767
         [struct ucred cr;
Packit 3c2767
          int cl = sizeof cr;
Packit 3c2767
          getsockopt (1, SOL_SOCKET, SO_PEERCRED, &cr, &cl);],
Packit 3c2767
          assuan_cv_sys_so_peercred=yes,
Packit 3c2767
          assuan_cv_sys_so_peercred=no)
Packit 3c2767
       ])
Packit 3c2767
AC_MSG_RESULT($assuan_cv_sys_so_peercred)
Packit 3c2767
Packit 3c2767
if test $assuan_cv_sys_so_peercred = yes; then
Packit 3c2767
  AC_DEFINE(HAVE_SO_PEERCRED, 1,
Packit 3c2767
            [Defined if SO_PEERCRED is supported (Linux specific)])
Packit 3c2767
else
Packit 3c2767
  # Check for the getsockopt LOCAL_PEEREID (NetBSD)
Packit 3c2767
  AC_MSG_CHECKING(for LOCAL_PEEREID)
Packit 3c2767
  AC_CACHE_VAL(assuan_cv_sys_so_local_peereid,
Packit 3c2767
      [AC_TRY_COMPILE([#include <sys/socket.>
Packit 3c2767
         #include <sys/un.h>],
Packit 3c2767
         [struct unpcbid unp;
Packit 3c2767
          int unpl = sizeof unp;
Packit 3c2767
          getsockopt (1, SOL_SOCKET, LOCAL_PEEREID, &unp, &unpl);],
Packit 3c2767
          assuan_cv_sys_so_local_peereid=yes,
Packit 3c2767
          assuan_cv_sys_so_local_peereid=no)
Packit 3c2767
       ])
Packit 3c2767
  AC_MSG_RESULT($assuan_cv_sys_so_local_peereid)
Packit 3c2767
Packit 3c2767
  if test $assuan_cv_sys_so_local_peereid = yes; then
Packit 3c2767
    AC_DEFINE(HAVE_LOCAL_PEEREID, 1,
Packit 3c2767
              [Defined if LOCAL_PEEREID is supported (NetBSD specific)])
Packit 3c2767
  else
Packit 3c2767
    # (Open)Solaris
Packit 3c2767
    AC_CHECK_FUNCS([getpeerucred], AC_CHECK_HEADERS([ucred.h]))
Packit 3c2767
    if test $ac_cv_func_getpeerucred != yes; then
Packit 3c2767
        # FreeBSD
Packit 3c2767
        AC_CHECK_FUNCS([getpeereid])
Packit 3c2767
    fi
Packit 3c2767
  fi
Packit 3c2767
fi
Packit 3c2767
Packit 3c2767
Packit 3c2767
#
Packit 3c2767
# Extra features
Packit 3c2767
#
Packit 3c2767
build_doc=yes
Packit 3c2767
AC_ARG_ENABLE([doc], AC_HELP_STRING([--disable-doc],
Packit 3c2767
                                    [do not build the documentation]),
Packit 3c2767
                     build_doc=$enableval, build_doc=yes)
Packit 3c2767
AM_CONDITIONAL([BUILD_DOC], [test "x$build_doc" != xno])
Packit 3c2767
Packit 3c2767
Packit 3c2767
#
Packit 3c2767
# Create the config files.
Packit 3c2767
#
Packit 3c2767
AC_CONFIG_FILES([Makefile])
Packit 3c2767
AC_CONFIG_FILES([m4/Makefile])
Packit 3c2767
AC_CONFIG_FILES([src/Makefile])
Packit 3c2767
AC_CONFIG_FILES([doc/Makefile])
Packit 3c2767
AC_CONFIG_FILES([tests/Makefile])
Packit 3c2767
AC_CONFIG_FILES([src/libassuan-config], [chmod +x src/libassuan-config])
Packit 3c2767
AC_CONFIG_FILES([src/versioninfo.rc])
Packit 3c2767
Packit 3c2767
AC_OUTPUT
Packit 3c2767
Packit 3c2767
echo "
Packit 3c2767
        Libassuan v${VERSION} has been configured as follows:
Packit 3c2767
Packit 3c2767
        Revision: mym4_revision  (mym4_revision_dec)
Packit 3c2767
        Platform: $host
Packit 3c2767
"