Allow comments beginning with '#' in the known host file.
[libpwmd.git] / configure.ac
blob185b66d0ce6bc0d13b14dc3bc60d49fc068f16fa
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([src/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_COMPAT="`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 AC_SUBST(VER_MAJOR)
20 AC_SUBST(VER_COMPAT)
21 AC_SUBST(VER_PATCH)
22 AC_SUBST(VER_COMPAT)
24 case "$target_os" in
25     darwin*)
26         LDFLAGS="$LDFLAGS -flat_namespace -L/sw/lib"
27         CPPFLAGS="$CPPFLAGS -I/sw/include -L/sw/lib"
28         ;;
29     *)
30         ;;
31 esac
33 CFLAGS="$CFLAGS -D_GNU_SOURCE"
35 dnl Checks for programs.
36 AC_PROG_CC
38 dnl Checks for header files.
39 AC_HEADER_STDC
40 AC_HEADER_SYS_WAIT
41 AC_CHECK_HEADERS([fcntl.h limits.h stdlib.h string.h unistd.h sys/socket.h])
43 dnl Checks for typedefs, structures, and compiler characteristics.
44 AC_C_CONST
45 AC_TYPE_SIZE_T
46 AC_STRUCT_TM
47 AC_TYPE_SSIZE_T
48 AC_TYPE_PID_T
50 AM_PATH_GPG_ERROR(,, AC_MSG_ERROR([Missing or incomplete libgpg-error installation.]))
51 AC_CHECK_PTH(, yes, yes, no, have_libpth=yes, have_libpth=no)
52 AM_CONDITIONAL([WITH_LIBPTH], [test "x$have_libpth" = "xyes"])
54 AC_ARG_ENABLE(tcp, AC_HELP_STRING([--disable-tcp],
55               [Disable TCP (ssh) support.]), WITH_TCP=no,
56               WITH_TCP=$enableval)
58 if test "x$WITH_TCP" = "xyes"; then
59     AC_CHECK_LIB(ssh2, libssh2_session_init_ex,,
60                       AC_MSG_ERROR([Missing or incomplete libssh2 installation.]))
61     PKG_CHECK_MODULES(libcares, libcares,,
62                       AC_MSG_ERROR([Missing or incomplete libcares installation.]))
63     AC_DEFINE(WITH_TCP, 1, [Define if you want TCP support.])
65 AM_CONDITIONAL([WITH_TCP], [test "x$WITH_TCP" = "xyes"])
67 dnl Checks for library functions.
68 AC_FUNC_MALLOC
69 AC_FUNC_REALLOC
70 AC_FUNC_STRFTIME
71 AC_FUNC_SELECT_ARGTYPES
72 AC_CHECK_FUNCS([memmove select socket strdup strerror setlocale getcwd \
73                 memset stpcpy strchr strrchr strtok_r])
75 AC_DEFUN([AC_MEM_DEBUG],
77     if test "$1"; then
78         ac_cv_sys_mem_debug=$1
79     fi
81     AC_CACHE_CHECK([if memory debugging is wanted], [ac_cv_sys_mem_debug],
82         [ac_cv_sys_mem_debug=no])
83     AM_CONDITIONAL([WITH_MEM_DEBUG], [test "$ac_cv_sys_mem_debug" = "yes"])
86 AC_ARG_ENABLE(mem_debug, AC_HELP_STRING([--enable-mem-debug],
87               [Enable memory debugging.]), AC_MEM_DEBUG([$enableval]),
88               AC_MEM_DEBUG)
90 AM_CONDITIONAL(MEM_DEBUG, test "x${ac_cv_sys_mem_debug}" != "xno")
92 AC_ARG_ENABLE(pinentry, AC_HELP_STRING([--disable-pinentry],
93               [Disable local pinentry(1) support.]), WITH_PINENTRY=no,
94               WITH_PINENTRY=$enableval)
96 if test "x$WITH_PINENTRY" != "xno"; then
97     AC_CHECK_HEADERS([locale.h])
98     AC_DEFINE(WITH_PINENTRY, 1, [Define if you want local pinentry(1) support.])
101 pinentry="/usr/bin/pinentry"
103 AC_ARG_WITH(pinentry, AC_HELP_STRING([--with-pinentry=PATH],
104               [Default location of the pinentry binary (/usr/bin/pinentry)]),
105               pinentry="$withval")
107 AC_SUBST(pinentry)
108 AC_DEFINE_UNQUOTED(PINENTRY_PATH, ["$pinentry"],
109                    [Default location of the pinentry binary.])
111 AC_CONFIG_FILES([Makefile libpwmd.pc libpwmd-pth.pc doc/Makefile \
112                  doc/libpwmd.3 doc/pwmc.1 src/Makefile src/libpwmd.h \
113                  po/Makefile.in])
114 AC_OUTPUT