configure.ac revision 1.35
1# $NetBSD: configure.ac,v 1.35 2010/09/02 06:00:11 agc Exp $ 2# 3# Process this file with autoconf to produce a configure script. 4 5AC_INIT([netpgp],[20100901],[Alistair Crooks <agc@netbsd.org> c0596823]) 6AC_PREREQ(2.63) 7AC_REVISION([$Revision: 1.35 $]) 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# try to see if we need to link with -ldl 42AC_SEARCH_LIBS(dlopen, dl) 43 44# Checks for header files. 45# 46AC_HEADER_STDC 47AC_CHECK_HEADERS([CommonCrypto/CommonDigest.h]) 48AC_CHECK_HEADERS([dmalloc.h direct.h errno.h fcntl.h \ 49 inttypes.h limits.h malloc.h zlib.h]) 50AC_CHECK_HEADERS([openssl/aes.h openssl/bn.h openssl/cast.h openssl/des.h \ 51 openssl/dsa.h openssl/err.h openssl/idea.h openssl/md5.h \ 52 openssl/rand.h openssl/rsa.h openssl/sha.h openssl/err.h \ 53 openssl/sha.h]) 54AC_CHECK_HEADERS([sys/cdefs.h sys/file.h sys/mman.h sys/param.h \ 55 sys/resource.h sys/uio.h]) 56 57AC_CHECK_HEADERS([bzlib.h], 58 [], 59 [AC_MSG_FAILURE([missing <bzlib.h>; is bzip2 installed?])]) 60 61# Checks for typedefs, structures, and compiler characteristics. 62# 63AC_TYPE_LONG_LONG_INT 64AC_TYPE_SIZE_T 65AC_TYPE_UINT16_T 66AC_TYPE_UINT32_T 67AC_TYPE_UINT64_T 68AC_TYPE_UINT8_T 69 70# check for openssl 71m4_include([ax_check_openssl.m4]) 72 73AX_CHECK_OPENSSL([LIBS="$LIBS $OPENSSL_LIBS" INCLUDES="$INCLUDES $OPENSSL_INCLUDES"], 74 [AC_MSG_ERROR([Missing OpenSSL])]) 75 76AC_CHECK_TYPES([SHA256_CTX], 77 [], 78 [AC_MSG_FAILURE([missing SHA256_CTX; is openssl 0.9.8 or newer installed?])], 79 [[ 80#if defined(HAVE_SYS_TYPES_H) 81#include <sys/types.h> 82#endif 83#if defined(HAVE_OPENSSL_SHA_H) 84#include <openssl/sha.h> 85#endif 86#if defined(HAVE_COMMONCRYPTO_COMMONDIGEST_H) 87#define COMMON_DIGEST_FOR_OPENSSL 1 88#include <CommonCrypto/CommonDigest.h> 89#endif 90]]) 91 92# Checks for library functions. 93# 94AC_SEARCH_LIBS([gzopen], [z]) 95AC_SEARCH_LIBS([BZ2_bzDecompress], [bz2]) 96AC_SEARCH_LIBS([RSA_public_encrypt], [crypto]) 97 98# Initialize the testsuite 99# 100AC_CONFIG_TESTDIR([tests]) 101AM_MISSING_PROG([AUTOM4TE], [autom4te]) 102 103# Generate the Makefiles 104# 105AC_CONFIG_FILES([ 106 Makefile 107 include/Makefile 108 src/Makefile 109 src/lib/Makefile 110 src/netpgp/Makefile 111 src/netpgpkeys/Makefile 112 src/netpgpverify/Makefile 113 tests/Makefile 114 tests/atlocal 115]) 116AC_OUTPUT 117 118# Display feature results 119# 120AC_MSG_NOTICE([ === Configuration results ===]) 121AC_MSG_NOTICE([Version: $PACKAGE_VERSION]) 122AC_MSG_NOTICE([C compiler: $CC]) 123AC_MSG_NOTICE([Warning CFLAGS: $WARNCFLAGS]) 124AC_MSG_NOTICE([=============================]) 125