configure.ac revision 1.22
1# $NetBSD: configure.ac,v 1.22 2010/02/08 17:19:12 agc Exp $
2#
3# Process this file with autoconf to produce a configure script.
4
5AC_INIT([netpgp],[20100208],[Alistair Crooks <agc@netbsd.org> c0596823])
6AC_PREREQ(2.63)
7AC_REVISION([$Revision: 1.22 $])
8
9AS_SHELL_SANITIZE
10
11AC_CONFIG_SRCDIR([src/netpgp/netpgp.c])
12AC_CONFIG_AUX_DIR([buildaux])
13AC_CONFIG_HEADER([src/lib/config.h])
14
15AM_INIT_AUTOMAKE([-Wall -Werror foreign])
16AM_MAINTAINER_MODE
17
18AC_CANONICAL_HOST
19CANONICAL_HOST=$host
20AC_SUBST([CANONICAL_HOST])
21
22# Checks for programs.
23#
24AC_PROG_MAKE_SET
25AC_PROG_AWK
26AC_PROG_CC
27AC_PROG_INSTALL
28AC_PROG_LIBTOOL
29AC_PROG_LN_S
30
31# Compiler characteristics
32#
33AC_MSG_CHECKING([if using gcc])
34AS_IF([test "$GCC" = "yes"],
35      [WARNCFLAGS="-Werror -Wall -Wpointer-arith"
36       AC_MSG_RESULT([yes; adding to CFLAGS: "$WARNCFLAGS"])],
37      [WARNCFLAGS=""
38       AC_MSG_RESULT([no])])
39AC_SUBST([WARNCFLAGS])
40
41# Checks for header files.
42#
43AC_HEADER_STDC
44AC_CHECK_HEADERS([CommonCrypto/CommonDigest.h])
45AC_CHECK_HEADERS([dmalloc.h direct.h errno.h fcntl.h \
46                 inttypes.h limits.h malloc.h zlib.h])
47AC_CHECK_HEADERS([openssl/aes.h openssl/bn.h openssl/cast.h openssl/des.h \
48                  openssl/dsa.h openssl/err.h openssl/idea.h openssl/md5.h \
49                  openssl/rand.h openssl/rsa.h openssl/sha.h openssl/err.h \
50                  openssl/sha.h])
51AC_CHECK_HEADERS([sys/cdefs.h sys/file.h sys/mman.h sys/param.h \
52                  sys/resource.h sys/uio.h])
53
54AC_CHECK_HEADERS([bzlib.h],
55                 [],
56                 [AC_MSG_FAILURE([missing <bzlib.h>; is bzip2 installed?])])
57
58# Checks for typedefs, structures, and compiler characteristics.
59#
60AC_TYPE_LONG_LONG_INT
61AC_TYPE_SIZE_T
62AC_TYPE_UINT16_T
63AC_TYPE_UINT32_T
64AC_TYPE_UINT64_T
65AC_TYPE_UINT8_T
66
67AC_CHECK_TYPES([SHA256_CTX],
68               [],
69               [AC_MSG_FAILURE([missing SHA256_CTX; is openssl 0.9.8 or newer installed?])],
70              [[
71#if defined(HAVE_SYS_TYPES_H)
72#include <sys/types.h>
73#endif
74#if defined(HAVE_OPENSSL_SHA_H)
75#include <openssl/sha.h>
76#endif
77#if defined(HAVE_COMMONCRYPTO_COMMONDIGEST_H)
78#define COMMON_DIGEST_FOR_OPENSSL 1
79#include <CommonCrypto/CommonDigest.h>
80#endif
81]])
82
83# Checks for library functions.
84#
85AC_SEARCH_LIBS([gzopen], [z])
86AC_SEARCH_LIBS([BZ2_bzDecompress], [bz2])
87AC_SEARCH_LIBS([RSA_public_encrypt], [crypto])
88
89# Initialize the testsuite
90#
91AC_CONFIG_TESTDIR([tests])
92AM_MISSING_PROG([AUTOM4TE], [autom4te])
93
94# Generate the Makefiles
95#
96AC_CONFIG_FILES([
97        Makefile
98        include/Makefile
99        src/Makefile
100        src/lib/Makefile
101        src/netpgp/Makefile
102        src/netpgpkeys/Makefile
103        src/netpgpverify/Makefile
104        tests/Makefile
105        tests/atlocal
106])
107AC_OUTPUT
108
109# Display feature results
110#
111AC_MSG_NOTICE([ === Configuration results ===])
112AC_MSG_NOTICE([Version:             $PACKAGE_VERSION])
113AC_MSG_NOTICE([C compiler:          $CC])
114AC_MSG_NOTICE([Warning CFLAGS:      $WARNCFLAGS])
115AC_MSG_NOTICE([=============================])
116