1
dnl -*- mode: shell-script; sh-indentation: 2; -*-
3
dnl Process this file with autoconf to produce a configure script.
5
AC_INIT([nettle], [1.10])
6
AC_CONFIG_SRCDIR([arcfour.c])
9
AM_CONFIG_HEADER([config.h])
16
# Command line options
17
AC_ARG_WITH(include-path,
18
AC_HELP_STRING([--with-include-path], [A colon-separated list of directories to search for include files]),,
19
[with_include_path=''])
21
if test x$with_include_path != x ; then
22
CPPFLAGS="$CPPFLAGS -I`echo $with_include_path | sed 's/:/ -I/g'`"
26
AC_HELP_STRING([--with-lib-path], [A colon-separated list of directories to search for libraries]),,
29
if test x$with_lib_path != x ; then
30
LDFLAGS="$LDFLAGS -L`echo $with_lib_path | sed 's/:/ -L/g'`"
33
AC_ARG_ENABLE(public-key,
34
AC_HELP_STRING([--disable-public-key], [Disable public key algorithms]),,
35
[enable_public_key=yes])
37
AC_ARG_ENABLE(assembler,
38
AC_HELP_STRING([--disable-assembler],[Disable assembler code]),,
39
[enable_assembler=yes])
42
AC_HELP_STRING([--enable-shared], [Build a shared library]),,
45
LSH_RPATH_INIT([`echo $with_lib_path | sed 's/:/ /g'` \
46
`echo $exec_prefix | sed "s@^NONE@$prefix/lib@g" | sed "s@^NONE@$ac_default_prefix/lib@g"` \
47
/usr/local/lib /sw/local/lib /sw/lib \
48
/usr/gnu/lib /opt/gnu/lib /sw/gnu/lib /usr/freeware/lib /usr/pkg/lib])
50
# Checks for programs.
53
# When $CC foo.c -o foo creates both foo and foo.exe, autoconf picks
54
# up the foo.exe and sets exeext to .exe. That is correct for cygwin,
55
# which has some kind of magic link from foo to foo.exe, but not for
56
# rntcl. A better check for the cygwin case would check if the
57
# contents of foo and foo.exe are equal; in the rntcl case, foo is a
58
# sh script, and foo.exe is a windows executable.
60
if test "x$CC" = xrntcl ; then
61
AC_MSG_NOTICE([Compiling with rntcl; clearing EXEEXT])
71
if test "x$am_cv_prog_cc_stdc" = xno ; then
72
AC_ERROR([the C compiler doesn't handle ANSI-C])
75
# Select assembler code
78
[i?86*-*-* | k[5-8]*-*-* | pentium*-*-* | athlon-*-*])
89
# echo "enable_assembler: $enable_assembler, asm_path: $asm_path"
91
if test "x$enable_assembler" = xyes ; then
92
if test -n "$asm_path"; then
93
AC_MSG_NOTICE([Looking for assembler files in $asm_path/.])
95
for tmp_f in aes.asm aes-encrypt.asm aes-decrypt.asm \
96
arcfour-crypt.asm sha1-compress.asm machine.m4; do
97
# echo "Looking for $srcdir/$asm_path/$tmp_f"
98
if test -f "$srcdir/$asm_path/$tmp_f"; then
101
AC_CONFIG_LINKS($tmp_f:$asm_path/$tmp_f)
104
if test "$found" = no; then
106
AC_MSG_WARN([No assembler files found.])
112
SHLIBFORLINK=libnettle.so
113
SHLIBSONAME='$(SHLIBFORLINK).$(SHLIBMAJOR)'
114
SHLIBFILE='$(SHLIBSONAME).$(SHLIBMINOR)'
115
SHLIBLINK='$(CC) $(LDFLAGS) -shared -Wl,-soname=$(SHLIBSONAME)'
117
echo "enable_shared: $enable_shared"
119
if test "x$enable_shared" = xyes ; then
120
SHLIBTARGET='$(SHLIBFORLINK)'
121
SHLIBINSTALL=install-shared
127
AM_CONDITIONAL([ENABLE_ASSEMBLER], [test x$enable_assembler = xyes])
128
AM_CONDITIONAL([ENABLE_SHARED], [test x$enable_shared = xyes])
130
AC_SUBST(SHLIBCFLAGS)
133
AC_SUBST(SHLIBFORLINK)
134
AC_SUBST(SHLIBSONAME)
137
AC_SUBST(SHLIBTARGET)
138
AC_SUBST(SHLIBINSTALL)
140
AC_PATH_PROG(M4, m4, m4)
142
# Checks for typedefs, structures, and compiler characteristics.
151
# Needed by the supplied memcmp.c
153
AC_REPLACE_FUNCS(memxor)
157
# According to Simon Josefsson, looking for uint32_t and friends in
158
# sys/types.h is needed on some systems, in particular cygwin.
159
AX_CREATE_STDINT_H([nettle-types.h], [sys/types.h])
161
# Checks for libraries
162
AC_CHECK_LIB(gmp, __gmpz_getlimbn,,
164
[GNU MP not found, or not 3.1 or up, see http://www.swox.com/gmp.
165
Support for public key algorithms will be unavailable.])]
166
enable_public_key=no)
168
if test "x$enable_public_key" = xyes ; then
169
AC_DEFINE(WITH_PUBLIC_KEY)
170
RSA_EXAMPLES='rsa-keygen$(EXEEXT) rsa-sign$(EXEEXT) rsa-verify$(EXEEXT) rsa-encrypt$(EXEEXT) rsa-decrypt$(EXEEXT)'
175
AH_TEMPLATE([WITH_PUBLIC_KEY], [Define to enable public key features])
176
AC_SUBST(RSA_EXAMPLES)
178
# Add -R flags needed to run programs linked with gmp
181
AH_TEMPLATE([HAVE_LIBCRYPTO],
182
[Define if you have openssl's libcrypto (used for benchmarking)])
186
# Check for openssl's libcrypto (used only for benchmarking)
187
AC_CHECK_LIB(crypto, BF_ecb_encrypt,
188
[AC_DEFINE(HAVE_LIBCRYPTO)
189
OPENSSL_LIBFLAGS='-lcrypto'
192
AC_SUBST(OPENSSL_LIBFLAGS)
194
# Set these flags *last*, or else the test programs won't compile
195
if test x$GCC = xyes ; then
196
# Using -ggdb3 makes (some versions of) Redhat's gcc-2.96 dump core
197
if "$CC" --version | grep '^2\.96$' 1>/dev/null 2>&1; then
200
CFLAGS="$CFLAGS -ggdb3"
202
CFLAGS="$CFLAGS -Wall -W \
203
-Wmissing-prototypes -Wmissing-declarations -Wstrict-prototypes \
204
-Wpointer-arith -Wbad-function-cast -Wnested-externs"
206
# Don't enable -Wcast-align as it results in tons of warnings in the
207
# DES code. And when using stdio.
208
# Don't enable -Waggregate-return, as that causes warnings for glibc
212
AC_OUTPUT(Makefile tools/Makefile testsuite/Makefile examples/Makefile config.m4)