Unofficial pwmd_tcp_connect() to a remote server. GnuTLS is used for
[libpwmd.git] / configure.ac
blob33c64c55f9f2019636e47a88f586686b57e5ca99
1 dnl Process this file with autoconf to produce a configure script.
2 AC_PREREQ(2.59)
3 AC_INIT(libpwmd, 5.0.7, [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])
15 case "$target_os" in
16     darwin*)
17         LDFLAGS="$LDFLAGS -flat_namespace -L/sw/lib"
18         CPPFLAGS="$CPPFLAGS -I/sw/include -L/sw/lib"
19         ;;
20     *)
21         ;;
22 esac
24 CFLAGS="$CFLAGS -D_GNU_SOURCE"
26 dnl Checks for programs.
27 AC_PROG_CC
29 dnl Checks for header files.
30 AC_HEADER_STDC
31 AC_HEADER_SYS_WAIT
32 AC_CHECK_HEADERS([fcntl.h limits.h stdlib.h string.h unistd.h sys/socket.h \
33                   assuan.h])
35 dnl Checks for typedefs, structures, and compiler characteristics.
36 AC_C_CONST
37 AC_TYPE_SIZE_T
38 AC_STRUCT_TM
39 AC_TYPE_SSIZE_T
40 AC_TYPE_PID_T
42 AM_PATH_LIBASSUAN(1.0.4,, AC_MSG_ERROR([libassuan not found]))
43 AM_PATH_GPG_ERROR(,, AC_MSG_ERROR([libgpg-error not found]))
44 AM_PATH_LIBGNUTLS(, AC_DEFINE(WITH_GNUTLS, 1, \
45                   [Define if you want GNUTLS support.]),
46                   AC_MSG_ERROR([libgnutls not found]))
48 dnl Checks for library functions.
49 AC_FUNC_MALLOC
50 AC_FUNC_REALLOC
51 AC_FUNC_STRFTIME
52 AC_FUNC_SELECT_ARGTYPES
53 AC_CHECK_FUNCS([memmove select socket strdup strerror setlocale getcwd \
54                 memset stpcpy strchr strrchr])
56 AC_DEFUN([AC_MEM_DEBUG],
58     if test "$1"; then
59         ac_cv_sys_mem_debug=$1
60     fi
62     AC_CACHE_CHECK([if memory debugging is wanted], [ac_cv_sys_mem_debug],
63         [ac_cv_sys_mem_debug=no])
64     AM_CONDITIONAL([WITH_MEM_DEBUG], [test "$ac_cv_sys_mem_debug" = "yes"])
67 AC_ARG_ENABLE(mem_debug, AC_HELP_STRING([--enable-mem-debug], [Enable memory debugging.]),
68     AC_MEM_DEBUG([$enableval]), AC_MEM_DEBUG)
70 AM_CONDITIONAL(MEM_DEBUG, test x"${ac_cv_sys_mem_debug}" != xno)
72 AC_ARG_ENABLE(pinentry, AC_HELP_STRING([--disable-pinentry], 
73               [Disable pinentry(1) support.]), USE_PINENTRY=no,
74               USE_PINENTRY=$enableval)
76 if test $USE_PINENTRY = "yes"; then
77     AC_CHECK_HEADERS([locale.h])
78     AC_DEFINE(USE_PINENTRY, 1, [Define if you want pinentry(1) support.])
81 AM_CONDITIONAL(USE_PINENTRY, [test $USE_PINENTRY = "yes"])
83 pinentry="/usr/bin/pinentry"
85 AC_ARG_WITH(pinentry, AC_HELP_STRING([--with-pinentry=PATH],
86               [Default location of the pinentry binary (/usr/bin/pinentry)]),
87               pinentry="$withval")
89 AC_SUBST(pinentry)
90 AC_DEFINE_UNQUOTED(PINENTRY_PATH, ["$pinentry"], [Default location of the pinentry binary.])
92 AC_CONFIG_FILES([Makefile libpwmd.pc libpwmd.3 pwmc.1 po/Makefile.in])
93 AC_OUTPUT