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])
7 AC_REVISION([$Revision: 1.20 $])
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])
20 AC_SUBST([CANONICAL_HOST])
22 # Checks for programs.
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"])],
39 AC_SUBST([WARNCFLAGS])
41 # Checks for header files.
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 \
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],
56 [AC_MSG_FAILURE([missing <bzlib.h>; is bzip2 installed?])])
58 # Checks for typedefs, structures, and compiler characteristics.
67 AC_CHECK_TYPES([SHA256_CTX],
69 [AC_MSG_FAILURE([missing SHA256_CTX; is openssl 0.9.8 or newer installed?])],
71 #if defined(HAVE_SYS_TYPES_H)
72 #include <sys/types.h>
74 #if defined(HAVE_OPENSSL_SHA_H)
75 #include <openssl/sha.h>
77 #if defined(HAVE_COMMONCRYPTO_COMMONDIGEST_H)
78 #define COMMON_DIGEST_FOR_OPENSSL 1
79 #include <CommonCrypto/CommonDigest.h>
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
102 src/netpgpkeys/Makefile
103 src/netpgpverify/Makefile
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([=============================])