Patrick Welche <prlw1@cam.ac.uk>
[netbsd-mini2440.git] / crypto / external / bsd / netpgp / dist / configure.ac
blob00b6879f50f3a144c27772a6783afa13373bcb7a
1 # $NetBSD: configure.ac,v 1.19 2009/12/14 23:29:56 agc Exp $
3 # Process this file with autoconf to produce a configure script.
5 AC_INIT([netpgp],[20091221],[Alistair Crooks <agc@netbsd.org> c0596823])
6 AC_PREREQ(2.63)
7 AC_REVISION([$Revision: 1.20 $])
9 AS_SHELL_SANITIZE
11 AC_CONFIG_SRCDIR([src/netpgp/netpgp.c])
12 AC_CONFIG_AUX_DIR([buildaux])
13 AC_CONFIG_HEADER([src/lib/config.h])
15 AM_INIT_AUTOMAKE([-Wall -Werror foreign])
16 AM_MAINTAINER_MODE
18 AC_CANONICAL_HOST
19 CANONICAL_HOST=$host
20 AC_SUBST([CANONICAL_HOST])
22 # Checks for programs.
24 AC_PROG_MAKE_SET
25 AC_PROG_AWK
26 AC_PROG_CC
27 AC_PROG_INSTALL
28 AC_PROG_LIBTOOL
29 AC_PROG_LN_S
31 # Compiler characteristics
33 AC_MSG_CHECKING([if using gcc])
34 AS_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])])
39 AC_SUBST([WARNCFLAGS])
41 # Checks for header files.
43 AC_HEADER_STDC
44 AC_CHECK_HEADERS([CommonCrypto/CommonDigest.h])
45 AC_CHECK_HEADERS([dmalloc.h direct.h errno.h fcntl.h \
46                  inttypes.h limits.h malloc.h zlib.h])
47 AC_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])
51 AC_CHECK_HEADERS([sys/cdefs.h sys/file.h sys/mman.h sys/param.h \
52                   sys/resource.h sys/uio.h])
54 AC_CHECK_HEADERS([bzlib.h],
55                  [],
56                  [AC_MSG_FAILURE([missing <bzlib.h>; is bzip2 installed?])])
58 # Checks for typedefs, structures, and compiler characteristics.
60 AC_TYPE_LONG_LONG_INT
61 AC_TYPE_SIZE_T
62 AC_TYPE_UINT16_T
63 AC_TYPE_UINT32_T
64 AC_TYPE_UINT64_T
65 AC_TYPE_UINT8_T
67 AC_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 ]])
83 # Checks for library functions.
85 AC_SEARCH_LIBS([gzopen], [z])
86 AC_SEARCH_LIBS([BZ2_bzDecompress], [bz2])
87 AC_SEARCH_LIBS([RSA_public_encrypt], [crypto])
89 # Initialize the testsuite
91 AC_CONFIG_TESTDIR([tests])
92 AM_MISSING_PROG([AUTOM4TE], [autom4te])
94 # Generate the Makefiles
96 AC_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
107 AC_OUTPUT
109 # Display feature results
111 AC_MSG_NOTICE([ === Configuration results ===])
112 AC_MSG_NOTICE([Version:             $PACKAGE_VERSION])
113 AC_MSG_NOTICE([C compiler:          $CC])
114 AC_MSG_NOTICE([Warning CFLAGS:      $WARNCFLAGS])
115 AC_MSG_NOTICE([=============================])