1 dnl Process this file with autoconf to produce a configure script.
3 AC_INIT(libpwmd, 5.0.8, [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])
15 VER_MAJOR="`echo "$VERSION" | sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\1/'`"
16 VER_MINOR="`echo "$VERSION" | sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\2/'`"
17 VER_PATCH="`echo "$VERSION" | sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'`"
26 LDFLAGS="$LDFLAGS -flat_namespace -L/sw/lib"
27 CPPFLAGS="$CPPFLAGS -I/sw/include -L/sw/lib"
33 CFLAGS="$CFLAGS -D_GNU_SOURCE"
35 dnl Checks for programs.
38 dnl Checks for header files.
41 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.
51 AM_PATH_LIBASSUAN(1.0.4,, AC_MSG_ERROR([libassuan not found]))
52 AM_PATH_GPG_ERROR(,, AC_MSG_ERROR([libgpg-error not found]))
53 AC_CHECK_PTH(, yes, yes, no, have_libpth=yes, have_libpth=no)
54 AM_CONDITIONAL([WITH_LIBPTH], [test "x$have_libpth" = "xyes"])
56 if test "x$have_libpth" = "xyes"; then
57 AM_PATH_LIBASSUAN_PTH(1.0.4,, AC_MSG_ERROR([libassuan-pth not found]))
60 dnl Checks for library functions.
64 AC_FUNC_SELECT_ARGTYPES
65 AC_CHECK_FUNCS([memmove select socket strdup strerror setlocale getcwd \
66 memset stpcpy strchr strrchr])
68 AC_DEFUN([AC_MEM_DEBUG],
71 ac_cv_sys_mem_debug=$1
74 AC_CACHE_CHECK([if memory debugging is wanted], [ac_cv_sys_mem_debug],
75 [ac_cv_sys_mem_debug=no])
76 AM_CONDITIONAL([WITH_MEM_DEBUG], [test "$ac_cv_sys_mem_debug" = "yes"])
79 AC_ARG_ENABLE(mem_debug, AC_HELP_STRING([--enable-mem-debug], [Enable memory debugging.]),
80 AC_MEM_DEBUG([$enableval]), AC_MEM_DEBUG)
82 AM_CONDITIONAL(MEM_DEBUG, test x"${ac_cv_sys_mem_debug}" != xno)
84 AC_ARG_ENABLE(pinentry, AC_HELP_STRING([--disable-pinentry],
85 [Disable pinentry(1) support.]), USE_PINENTRY=no,
86 USE_PINENTRY=$enableval)
88 if test $USE_PINENTRY = "yes"; then
89 AC_CHECK_HEADERS([locale.h])
90 AC_DEFINE(USE_PINENTRY, 1, [Define if you want pinentry(1) support.])
93 AM_CONDITIONAL(USE_PINENTRY, [test $USE_PINENTRY = "yes"])
95 pinentry="/usr/bin/pinentry"
97 AC_ARG_WITH(pinentry, AC_HELP_STRING([--with-pinentry=PATH],
98 [Default location of the pinentry binary (/usr/bin/pinentry)]),
102 AC_DEFINE_UNQUOTED(PINENTRY_PATH, ["$pinentry"], [Default location of the pinentry binary.])
104 AC_CONFIG_FILES([Makefile libpwmd.h libpwmd.pc libpwmd-pth.pc libpwmd.3 \
105 pwmc.1 po/Makefile.in])