forked from oesmith/netpgp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
135 lines (116 loc) · 3.52 KB
/
configure.ac
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
# $NetBSD: configure.ac,v 1.39 2010/11/06 00:14:35 agc Exp $
#
# Process this file with autoconf to produce a configure script.
AC_INIT([netpgp],[20101107],[Alistair Crooks <[email protected]> c0596823])
AC_PREREQ(2.61)
AC_REVISION([$Revision: 1.39 $])
AS_SHELL_SANITIZE
AC_CONFIG_SRCDIR([src/netpgp/netpgp.c])
AC_CONFIG_AUX_DIR([buildaux])
AC_CONFIG_HEADER([src/lib/config.h])
AM_INIT_AUTOMAKE([-Wall -Werror foreign])
AM_MAINTAINER_MODE
# Enable/disable programs
#
AC_ARG_ENABLE([programs],
[ --enable-programs Turn on programs (netpgp, netpgpverify, netpgpkeys)],
[case "${enableval}" in
yes) programs=true ;;
no) programs=false ;;
*) AC_MSG_ERROR([bad value ${enableval} for --enable-programs]) ;;
esac],[programs=true])
AM_CONDITIONAL([BUILD_PROGRAMS], [test x$programs = xtrue])
AC_CANONICAL_HOST
CANONICAL_HOST=$host
AC_SUBST([CANONICAL_HOST])
# Checks for programs.
#
AC_PROG_MAKE_SET
AC_PROG_AWK
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_LIBTOOL
AC_PROG_LN_S
# Compiler characteristics
#
AC_MSG_CHECKING([if using gcc])
AS_IF([test "$GCC" = "yes"],
[WARNCFLAGS="-Werror -Wall -Wpointer-arith"
AC_MSG_RESULT([yes; adding to CFLAGS: "$WARNCFLAGS"])],
[WARNCFLAGS=""
AC_MSG_RESULT([no])])
AC_SUBST([WARNCFLAGS])
# try to see if we need to link with -ldl
AC_SEARCH_LIBS(dlopen, dl)
# Checks for header files.
#
AC_HEADER_STDC
AC_CHECK_HEADERS([CommonCrypto/CommonDigest.h])
AC_CHECK_HEADERS([dmalloc.h direct.h errno.h fcntl.h \
inttypes.h limits.h malloc.h zlib.h])
AC_CHECK_HEADERS([openssl/aes.h openssl/bn.h openssl/camellia.h openssl/cast.h \
openssl/des.h openssl/dsa.h openssl/err.h openssl/idea.h \
openssl/md5.h openssl/rand.h openssl/rsa.h openssl/sha.h \
openssl/err.h openssl/sha.h])
AC_CHECK_HEADERS([sys/cdefs.h sys/file.h sys/mman.h sys/param.h \
sys/resource.h sys/uio.h])
AC_CHECK_HEADERS([bzlib.h],
[],
[AC_MSG_FAILURE([missing <bzlib.h>; is bzip2 installed?])])
# Checks for typedefs, structures, and compiler characteristics.
#
AC_TYPE_LONG_LONG_INT
AC_TYPE_SIZE_T
AC_TYPE_UINT16_T
AC_TYPE_UINT32_T
AC_TYPE_UINT64_T
AC_TYPE_UINT8_T
# check for openssl
m4_include([ax_check_openssl.m4])
AX_CHECK_OPENSSL([LIBS="$LIBS $OPENSSL_LIBS" INCLUDES="$INCLUDES $OPENSSL_INCLUDES"],
[AC_MSG_ERROR([Missing OpenSSL])])
AC_CHECK_TYPES([SHA256_CTX],
[],
[AC_MSG_FAILURE([missing SHA256_CTX; is openssl 0.9.8 or newer installed?])],
[[
#if defined(HAVE_SYS_TYPES_H)
#include <sys/types.h>
#endif
#if defined(HAVE_OPENSSL_SHA_H)
#include <openssl/sha.h>
#endif
#if defined(HAVE_COMMONCRYPTO_COMMONDIGEST_H)
#define COMMON_DIGEST_FOR_OPENSSL 1
#include <CommonCrypto/CommonDigest.h>
#endif
]])
# Checks for library functions.
#
AC_SEARCH_LIBS([gzopen], [z])
AC_SEARCH_LIBS([BZ2_bzDecompress], [bz2])
AC_SEARCH_LIBS([RSA_public_encrypt], [crypto])
# Initialize the testsuite
#
AC_CONFIG_TESTDIR([tests])
AM_MISSING_PROG([AUTOM4TE], [autom4te])
# Generate the Makefiles
#
AC_CONFIG_FILES([
Makefile
include/Makefile
src/Makefile
src/lib/Makefile
src/netpgp/Makefile
src/netpgpverify/Makefile
src/netpgpkeys/Makefile
tests/Makefile
tests/atlocal
])
AC_OUTPUT
# Display feature results
#
AC_MSG_NOTICE([ === Configuration results ===])
AC_MSG_NOTICE([Version: $PACKAGE_VERSION])
AC_MSG_NOTICE([C compiler: $CC])
AC_MSG_NOTICE([Warning CFLAGS: $WARNCFLAGS])
AC_MSG_NOTICE([=============================])