Added assuan_socket_connect_fd() and assuan_set_finish_handler().
[libpwmd.git] / configure.ac
blobbe9f5aaee2534ec4551287f957f59788eb96fd11
1 dnl Process this file with autoconf to produce a configure script.
2 AC_PREREQ(2.59)
3 AC_INIT(libpwmd, 5.0.8, [Ben Kibbey bjk@luxsci.net])
4 AC_CONFIG_AUX_DIR(build)
5 AC_CANONICAL_TARGET
6 AM_INIT_AUTOMAKE([foreign])
7 AC_PROG_MAKE_SET
8 #AC_DISABLE_SHARED
9 AC_PROG_LIBTOOL
10 AC_CONFIG_SRCDIR([libpwmd.c])
11 AM_CONFIG_HEADER([config.h])
12 AM_GNU_GETTEXT([external])
13 AM_GNU_GETTEXT_VERSION([0.16.1])
14 AC_CONFIG_SUBDIRS([assuan])
16 VER_MAJOR="`echo "$VERSION" | sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\1/'`"
17 VER_MINOR="`echo "$VERSION" | sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\2/'`"
18 VER_PATCH="`echo "$VERSION" | sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'`"
19 VER_COMPAT=0
20 AC_SUBST(VER_MAJOR)
21 AC_SUBST(VER_MINOR)
22 AC_SUBST(VER_PATCH)
23 AC_SUBST(VER_COMPAT)
25 case "$target_os" in
26     darwin*)
27         LDFLAGS="$LDFLAGS -flat_namespace -L/sw/lib"
28         CPPFLAGS="$CPPFLAGS -I/sw/include -L/sw/lib"
29         ;;
30     *)
31         ;;
32 esac
34 CFLAGS="$CFLAGS -D_GNU_SOURCE"
36 dnl Checks for programs.
37 AC_PROG_CC
39 dnl Checks for header files.
40 AC_HEADER_STDC
41 AC_HEADER_SYS_WAIT
42 AC_CHECK_HEADERS([fcntl.h limits.h stdlib.h string.h unistd.h sys/socket.h])
44 dnl Checks for typedefs, structures, and compiler characteristics.
45 AC_C_CONST
46 AC_TYPE_SIZE_T
47 AC_STRUCT_TM
48 AC_TYPE_SSIZE_T
49 AC_TYPE_PID_T
51 AM_PATH_GPG_ERROR(,, AC_MSG_ERROR([Missing or incomplete libgpg-error installation.]))
52 AC_CHECK_PTH(, yes, yes, no, have_libpth=yes, have_libpth=no)
53 AM_CONDITIONAL([WITH_LIBPTH], [test "x$have_libpth" = "xyes"])
55 AC_ARG_ENABLE(tcp, AC_HELP_STRING([--disable-tcp],
56               [Disable TCP (GnuTLS) support.]), WITH_TCP=no,
57               WITH_TCP=$enableval)
59 if test "x$WITH_TCP" = "xyes"; then
60     AM_PATH_LIBGNUTLS(, AC_DEFINE(HAVE_LIBGNUTLS, 1,
61                       [Define if you want TCP (GnuTLS) support.]),
62                       AC_MSG_ERROR([Missing or incomplete libgnutls installation.]))
63     PKG_CHECK_MODULES(libcares, libcares,,
64                       AC_MSG_ERROR([Missing or incomplete libcares installation.]))
65     AC_DEFINE(WITH_TCP, 1, [Define if you want TCP support.])
67 AM_CONDITIONAL([WITH_TCP], [test "x$WITH_TCP" = "xyes"])
69 dnl Checks for library functions.
70 AC_FUNC_MALLOC
71 AC_FUNC_REALLOC
72 AC_FUNC_STRFTIME
73 AC_FUNC_SELECT_ARGTYPES
74 AC_CHECK_FUNCS([memmove select socket strdup strerror setlocale getcwd \
75                 memset stpcpy strchr strrchr strtok_r])
77 AC_DEFUN([AC_MEM_DEBUG],
79     if test "$1"; then
80         ac_cv_sys_mem_debug=$1
81     fi
83     AC_CACHE_CHECK([if memory debugging is wanted], [ac_cv_sys_mem_debug],
84         [ac_cv_sys_mem_debug=no])
85     AM_CONDITIONAL([WITH_MEM_DEBUG], [test "$ac_cv_sys_mem_debug" = "yes"])
88 AC_ARG_ENABLE(mem_debug, AC_HELP_STRING([--enable-mem-debug],
89               [Enable memory debugging.]), AC_MEM_DEBUG([$enableval]),
90               AC_MEM_DEBUG)
92 AM_CONDITIONAL(MEM_DEBUG, test "x${ac_cv_sys_mem_debug}" != "xno")
94 AC_ARG_ENABLE(pinentry, AC_HELP_STRING([--disable-pinentry],
95               [Disable local pinentry(1) support.]), WITH_PINENTRY=no,
96               WITH_PINENTRY=$enableval)
98 if test "x$WITH_PINENTRY" != "xno"; then
99     AC_CHECK_HEADERS([locale.h])
100     AC_DEFINE(WITH_PINENTRY, 1, [Define if you want local pinentry(1) support.])
103 pinentry="/usr/bin/pinentry"
105 AC_ARG_WITH(pinentry, AC_HELP_STRING([--with-pinentry=PATH],
106               [Default location of the pinentry binary (/usr/bin/pinentry)]),
107               pinentry="$withval")
109 AC_SUBST(pinentry)
110 AC_DEFINE_UNQUOTED(PINENTRY_PATH, ["$pinentry"],
111                    [Default location of the pinentry binary.])
113 AC_CONFIG_FILES([Makefile libpwmd.h libpwmd.pc libpwmd-pth.pc libpwmd.3 \
114                  pwmc.1 po/Makefile.in])
115 AC_OUTPUT