1 dnl Process this file with autoconf to produce a configure script.
3 AC_INIT(libpwmd, 5.0.7, [Ben Kibbey bjk@luxsci.net])
4 AC_CONFIG_AUX_DIR(build)
6 AM_INIT_AUTOMAKE([foreign])
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])
17 LDFLAGS="$LDFLAGS -flat_namespace -L/sw/lib"
18 CPPFLAGS="$CPPFLAGS -I/sw/include -L/sw/lib"
24 CFLAGS="$CFLAGS -D_GNU_SOURCE"
26 dnl Checks for programs.
29 dnl Checks for header files.
32 AC_CHECK_HEADERS([fcntl.h limits.h stdlib.h string.h unistd.h sys/socket.h \
35 dnl Checks for typedefs, structures, and compiler characteristics.
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 AC_CHECK_PTH(, yes, yes, no, have_libpth=yes, have_libpth=no)
45 AM_CONDITIONAL([WITH_LIBPTH], [test "x$have_libpth" = "xyes"])
47 if test "x$have_libpth" = "xyes"; then
48 AM_PATH_LIBASSUAN_PTH(1.0.4,, AC_MSG_ERROR([libassuan-pth not found]))
51 dnl Checks for library functions.
55 AC_FUNC_SELECT_ARGTYPES
56 AC_CHECK_FUNCS([memmove select socket strdup strerror setlocale getcwd \
57 memset stpcpy strchr strrchr])
59 AC_DEFUN([AC_MEM_DEBUG],
62 ac_cv_sys_mem_debug=$1
65 AC_CACHE_CHECK([if memory debugging is wanted], [ac_cv_sys_mem_debug],
66 [ac_cv_sys_mem_debug=no])
67 AM_CONDITIONAL([WITH_MEM_DEBUG], [test "$ac_cv_sys_mem_debug" = "yes"])
70 AC_ARG_ENABLE(mem_debug, AC_HELP_STRING([--enable-mem-debug], [Enable memory debugging.]),
71 AC_MEM_DEBUG([$enableval]), AC_MEM_DEBUG)
73 AM_CONDITIONAL(MEM_DEBUG, test x"${ac_cv_sys_mem_debug}" != xno)
75 AC_ARG_ENABLE(pinentry, AC_HELP_STRING([--disable-pinentry],
76 [Disable pinentry(1) support.]), USE_PINENTRY=no,
77 USE_PINENTRY=$enableval)
79 if test $USE_PINENTRY = "yes"; then
80 AC_CHECK_HEADERS([locale.h])
81 AC_DEFINE(USE_PINENTRY, 1, [Define if you want pinentry(1) support.])
84 AM_CONDITIONAL(USE_PINENTRY, [test $USE_PINENTRY = "yes"])
86 pinentry="/usr/bin/pinentry"
88 AC_ARG_WITH(pinentry, AC_HELP_STRING([--with-pinentry=PATH],
89 [Default location of the pinentry binary (/usr/bin/pinentry)]),
93 AC_DEFINE_UNQUOTED(PINENTRY_PATH, ["$pinentry"], [Default location of the pinentry binary.])
95 AC_CONFIG_FILES([Makefile libpwmd.pc libpwmd.3 pwmc.1 po/Makefile.in])