Initial commit.
[libpwmd.git] / configure.ac
blob717d210da2f695f47f1149ebb1d92e080ea2b1b6
1 dnl Process this file with autoconf to produce a configure script.
2 AC_PREREQ(2.59)
3 AC_INIT(libpwmd, 2.0.3, [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])
13 case "$target_os" in
14     darwin*)
15         LDFLAGS="$LDFLAGS -flat_namespace -L/sw/lib"
16         CPPFLAGS="$CPPFLAGS -I/sw/include -L/sw/lib"
17         ;;
18     *)
19         ;;
20 esac
22 CFLAGS="$CFLAGS -D_GNU_SOURCE"
24 dnl Checks for programs.
25 AC_PROG_CC
27 dnl Checks for header files.
28 AC_HEADER_STDC
29 AC_HEADER_SYS_WAIT
30 AC_CHECK_HEADERS([fcntl.h limits.h stdlib.h string.h unistd.h sys/socket.h])
32 dnl Checks for typedefs, structures, and compiler characteristics.
33 AC_C_CONST
34 AC_TYPE_SIZE_T
35 AC_STRUCT_TM
36 AC_TYPE_SSIZE_T
37 AC_TYPE_PID_T
39 dnl Checks for library functions.
40 AC_FUNC_MALLOC
41 AC_FUNC_REALLOC
42 AC_FUNC_STRFTIME
43 AC_FUNC_SELECT_ARGTYPES
44 AC_CHECK_FUNCS([memmove select socket strdup strerror setlocale getcwd \
45                 memset stpcpy strchr strrchr])
47 AC_ARG_ENABLE(pinentry, AC_HELP_STRING([--disable-pinentry], 
48               [Disable pinentry(1) support.]), USE_PINENTRY=no,
49               USE_PINENTRY=$enableval)
51 if test $USE_PINENTRY = "yes"; then
52     AM_PATH_GPG_ERROR(,, AC_MSG_ERROR([libgpg-error not found]))
53     AM_PATH_LIBASSUAN(,, AC_MSG_ERROR([libassuan not found]))
54     AC_CHECK_HEADERS([assuan.h locale.h])
55     AC_DEFINE(USE_PINENTRY, 1, [Define if you want pinentry(1) support.])
58 AM_CONDITIONAL(USE_PINENTRY, [test $USE_PINENTRY = "yes"])
59 AC_SUBST(prefix)
60 AC_SUBST(exec_prefix)
61 AC_SUBST(PACKAGE_VERSION)
63 AC_CONFIG_FILES([Makefile libpwmd.pc libpwmd.3])
64 AC_OUTPUT