Remove building with NOCRYPTO option
[minix3.git] / crypto / external / bsd / netpgp / dist / configure.ac
blob9bf72411097dba0f3d30a3f80a2e828acac69b19
1 # $NetBSD: configure.ac,v 1.42 2014/03/09 00:33:50 agc Exp $
3 # Process this file with autoconf to produce a configure script.
5 AC_INIT([netpgp],[20140220],[Alistair Crooks <agc@netbsd.org> c0596823])
6 AC_PREREQ(2.69)
7 AC_REVISION([$Revision: 1.42 $])
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 dnl based on AC_PROG_RANLIB from autoconf
32 m4_ifndef([AC_PROG_AR],[dnl
33 AN_MAKEVAR([AR], [AC_PROG_AR])
34 AN_PROGRAM([ar], [AC_PROG_AR])
35 AC_DEFUN([AC_PROG_AR],
36 [AC_CHECK_TOOL(AR, ar, :)])
39 AC_PROG_AR
41 # Compiler characteristics
43 AC_MSG_CHECKING([if using gcc])
44 AS_IF([test "$GCC" = "yes"],
45       [WARNCFLAGS="-Werror -Wall -Wpointer-arith"
46        AC_MSG_RESULT([yes; adding to CFLAGS: "$WARNCFLAGS"])],
47       [WARNCFLAGS=""
48        AC_MSG_RESULT([no])])
49 AC_SUBST([WARNCFLAGS])
51 # try to see if we need to link with -ldl
52 AC_SEARCH_LIBS(dlopen, dl)
54 # Checks for header files.
56 AC_HEADER_STDC
57 AC_CHECK_HEADERS([CommonCrypto/CommonDigest.h])
58 AC_CHECK_HEADERS([dmalloc.h direct.h errno.h fcntl.h \
59                  inttypes.h limits.h malloc.h zlib.h])
60 AC_CHECK_HEADERS([openssl/aes.h openssl/bn.h openssl/camellia.h openssl/cast.h \
61                   openssl/des.h openssl/dsa.h openssl/err.h openssl/idea.h \
62                   openssl/md5.h openssl/rand.h openssl/rsa.h openssl/sha.h \
63                   openssl/err.h openssl/sha.h])
64 AC_CHECK_HEADERS([sys/cdefs.h sys/file.h sys/mman.h sys/param.h \
65                   sys/resource.h sys/uio.h])
67 AC_CHECK_HEADERS([bzlib.h],
68                  [],
69                  [AC_MSG_FAILURE([missing <bzlib.h>; is bzip2 installed?])])
71 # Checks for typedefs, structures, and compiler characteristics.
73 AC_TYPE_LONG_LONG_INT
74 AC_TYPE_SIZE_T
75 AC_TYPE_UINT16_T
76 AC_TYPE_UINT32_T
77 AC_TYPE_UINT64_T
78 AC_TYPE_UINT8_T
80 # check for openssl
81 m4_include([ax_check_openssl.m4])
83 AX_CHECK_OPENSSL([LIBS="$LIBS $OPENSSL_LIBS" INCLUDES="$INCLUDES $OPENSSL_INCLUDES"],
84         [AC_MSG_ERROR([Missing OpenSSL])])
86 AC_CHECK_TYPES([SHA256_CTX],
87                [],
88                [AC_MSG_FAILURE([missing SHA256_CTX; is openssl 0.9.8 or newer installed?])],
89               [[
90 #if defined(HAVE_SYS_TYPES_H)
91 #include <sys/types.h>
92 #endif
93 #if defined(HAVE_OPENSSL_SHA_H)
94 #include <openssl/sha.h>
95 #endif
96 #if defined(HAVE_COMMONCRYPTO_COMMONDIGEST_H)
97 #define COMMON_DIGEST_FOR_OPENSSL 1
98 #include <CommonCrypto/CommonDigest.h>
99 #endif
102 # Checks for library functions.
104 AC_SEARCH_LIBS([gzopen], [z])
105 AC_SEARCH_LIBS([BZ2_bzDecompress], [bz2])
106 AC_SEARCH_LIBS([RSA_public_encrypt], [crypto])
108 # Initialize the testsuite
110 AC_CONFIG_TESTDIR([tests])
111 AM_MISSING_PROG([AUTOM4TE], [autom4te])
113 # Generate the Makefiles
115 AC_CONFIG_FILES([
116         Makefile
117         include/Makefile
118         src/Makefile
119         src/libmj/Makefile
120         src/lib/Makefile
121         src/netpgp/Makefile
122         src/netpgpkeys/Makefile
123         tests/Makefile
124         tests/atlocal
126 AC_OUTPUT
128 # Display feature results
130 AC_MSG_NOTICE([ === Configuration results ===])
131 AC_MSG_NOTICE([Version:             $PACKAGE_VERSION])
132 AC_MSG_NOTICE([C compiler:          $CC])
133 AC_MSG_NOTICE([Warning CFLAGS:      $WARNCFLAGS])
134 AC_MSG_NOTICE([=============================])