configure.ac revision 1.12
1# $Id: configure.ac,v 1.12 2009/05/26 04:27:29 lukem Exp $
2#
3# Process this file with autoconf to produce a configure script.
4
5AC_INIT([netpgp], [20090525], [Alistair Crooks <agc@netbsd.org> c0596823])
6AC_PREREQ([2.62])
7AC_REVISION([$Revision: 1.12 $])
8
9AS_SHELL_SANITIZE
10
11AC_CONFIG_SRCDIR([src/bin/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([bzlib.h dmalloc.h direct.h errno.h fcntl.h])
46AC_CHECK_HEADERS([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
54# Checks for typedefs, structures, and compiler characteristics.
55#
56AC_TYPE_UINT8_T
57AC_TYPE_UINT16_T
58AC_TYPE_UINT32_T
59AC_TYPE_UINT64_T
60
61AC_CHECK_TYPES([SHA256_CTX],
62               [],
63               [AC_MSG_FAILURE([missing SHA256_CTX; is openssl 0.9.8 or newer installed?])],
64               [[#include <openssl/sha.h>]])
65
66# Checks for library functions.
67#
68AC_SEARCH_LIBS([gzopen], [z])
69AC_SEARCH_LIBS([BZ2_bzDecompress], [bz2])
70AC_SEARCH_LIBS([RSA_public_encrypt], [crypto])
71
72# Initialize the testsuite
73#
74AC_CONFIG_TESTDIR([tests])
75AM_MISSING_PROG([AUTOM4TE], [autom4te])
76
77# Generate the Makefiles
78#
79AC_CONFIG_FILES([
80        Makefile
81        include/Makefile
82        src/Makefile
83        src/lib/Makefile
84        src/bin/Makefile
85        tests/Makefile
86        tests/atlocal
87])
88AC_OUTPUT
89
90# Display feature results
91#
92AC_MSG_NOTICE([ === Configuration results ===])
93AC_MSG_NOTICE([Version:             $PACKAGE_VERSION])
94AC_MSG_NOTICE([C compiler:          $CC])
95AC_MSG_NOTICE([Warning CFLAGS:      $WARNCFLAGS])
96AC_MSG_NOTICE([=============================])
97