2014-07-04 11:18:53 +00:00
|
|
|
AC_PREREQ([2.63])
|
2014-08-01 14:31:07 +00:00
|
|
|
AC_INIT([cryb.to], [devel], [des@des.no], [crybto], [http://cryb.to/])
|
2014-07-04 11:18:53 +00:00
|
|
|
AC_CONFIG_SRCDIR([include/cryb/to.h])
|
|
|
|
AC_CONFIG_MACRO_DIR([m4])
|
|
|
|
AM_INIT_AUTOMAKE([foreign])
|
|
|
|
AM_CONFIG_HEADER([include/config.h])
|
|
|
|
|
2014-07-13 19:59:58 +00:00
|
|
|
############################################################################
|
|
|
|
#
|
|
|
|
# Toolchain
|
|
|
|
#
|
|
|
|
|
2014-07-04 11:18:53 +00:00
|
|
|
# C compiler and features
|
|
|
|
AC_LANG(C)
|
|
|
|
AC_PROG_CC
|
|
|
|
AC_PROG_CC_STDC
|
|
|
|
AC_PROG_CPP
|
2014-10-30 12:55:36 +00:00
|
|
|
AC_GNU_SOURCE
|
2014-07-04 11:18:53 +00:00
|
|
|
AC_C_CONST
|
|
|
|
AC_C_RESTRICT
|
|
|
|
AC_C_VOLATILE
|
|
|
|
AC_C_BIGENDIAN
|
|
|
|
|
|
|
|
# libtool
|
|
|
|
LT_PREREQ([2.2.6])
|
|
|
|
LT_INIT()
|
|
|
|
|
|
|
|
# other programs
|
|
|
|
AC_PROG_INSTALL
|
|
|
|
|
2014-07-13 19:59:58 +00:00
|
|
|
############################################################################
|
|
|
|
#
|
|
|
|
# Headers and functions
|
|
|
|
#
|
2014-07-04 11:18:53 +00:00
|
|
|
|
2014-07-13 19:59:58 +00:00
|
|
|
AC_CHECK_HEADERS([endian.h sys/endian.h])
|
2015-08-17 15:37:07 +00:00
|
|
|
AC_CHECK_DECLS([
|
|
|
|
be16enc, be16dec, le16enc, le16dec,
|
|
|
|
be32enc, be32dec, le32enc, le32dec,
|
|
|
|
be64enc, be64dec, le64enc, le64dec
|
|
|
|
], [], [], [[
|
2014-12-20 00:38:54 +00:00
|
|
|
#if HAVE_SYS_ENDIAN_H
|
2014-10-30 13:24:53 +00:00
|
|
|
#include <sys/endian.h>
|
|
|
|
#endif
|
2014-12-20 00:38:54 +00:00
|
|
|
#if HAVE_ENDIAN_H
|
2014-10-30 13:24:53 +00:00
|
|
|
#include <endian.h>
|
|
|
|
#endif
|
|
|
|
]])
|
2014-07-13 19:59:58 +00:00
|
|
|
AC_CHECK_FUNCS([strlcat strlcmp strlcpy])
|
|
|
|
|
2014-10-30 12:05:45 +00:00
|
|
|
# For tracing allocations in unit tests
|
2014-10-30 13:07:16 +00:00
|
|
|
AC_CHECK_HEADERS([sys/uio.h sys/ktrace.h], [], [], [[
|
|
|
|
#include <sys/param.h>
|
2014-12-20 00:38:54 +00:00
|
|
|
#if HAVE_SYS_UIO_H
|
2014-10-30 13:07:16 +00:00
|
|
|
#include <sys/uio.h>
|
|
|
|
#endif
|
|
|
|
]])
|
2014-10-30 12:05:45 +00:00
|
|
|
AC_CHECK_FUNCS([utrace])
|
|
|
|
|
2015-02-15 09:18:18 +00:00
|
|
|
# C11 features
|
|
|
|
# XXX our version has an incorrect prototype due to the lack of a test
|
|
|
|
# for the existence of rsize_t and RSIZE_MAX.
|
|
|
|
AC_CHECK_FUNCS([memset_s])
|
|
|
|
|
2014-10-30 12:55:36 +00:00
|
|
|
############################################################################
|
|
|
|
#
|
|
|
|
# Extra libraries
|
|
|
|
#
|
|
|
|
|
|
|
|
save_LIBS="${LIBS}"
|
|
|
|
LIBS=""
|
2014-10-30 14:32:46 +00:00
|
|
|
AC_SEARCH_LIBS([clock_gettime], [rt])
|
2014-10-30 12:55:36 +00:00
|
|
|
RT_LIBS="${LIBS}"
|
|
|
|
LIBS="${save_LIBS}"
|
|
|
|
AC_SUBST(RT_LIBS)
|
|
|
|
|
2014-07-13 19:59:58 +00:00
|
|
|
############################################################################
|
|
|
|
#
|
|
|
|
# Build options
|
|
|
|
#
|
2014-07-04 11:18:53 +00:00
|
|
|
|
|
|
|
# Documentation
|
|
|
|
AC_ARG_WITH([doc],
|
|
|
|
AC_HELP_STRING([--without-doc],
|
|
|
|
[do not build the documentation]),
|
|
|
|
[],
|
|
|
|
[with_doc=yes])
|
|
|
|
AM_CONDITIONAL([WITH_DOC], [test x"$with_doc" = x"yes"])
|
|
|
|
|
|
|
|
# Message digests
|
|
|
|
AC_ARG_WITH([digest],
|
|
|
|
AC_HELP_STRING([--without-digest],
|
|
|
|
[do not build the message digest library and tools]),
|
|
|
|
[],
|
|
|
|
[with_digest=yes])
|
|
|
|
AM_CONDITIONAL([WITH_DIGEST], [test x"$with_digest" = x"yes"])
|
|
|
|
|
|
|
|
# Message authentication codes
|
|
|
|
AC_ARG_WITH([mac],
|
|
|
|
AC_HELP_STRING([--without-mac],
|
|
|
|
[do not build the message authentication code library and tools]),
|
|
|
|
[],
|
|
|
|
[with_mac=yes])
|
|
|
|
AM_CONDITIONAL([WITH_MAC], [test x"$with_digest" = x"yes"])
|
|
|
|
|
|
|
|
# OATH
|
|
|
|
AC_ARG_WITH([oath],
|
|
|
|
AC_HELP_STRING([--without-oath],
|
|
|
|
[do not build the OATH library and tools]),
|
|
|
|
[],
|
|
|
|
[with_oath=yes])
|
|
|
|
AM_CONDITIONAL([WITH_OATH], [test x"$with_oath" = x"yes"])
|
|
|
|
|
2014-07-13 19:59:58 +00:00
|
|
|
############################################################################
|
|
|
|
#
|
|
|
|
# Debugging
|
|
|
|
#
|
|
|
|
|
|
|
|
# OpenSSL versions of the unit tests for comparison
|
|
|
|
AC_ARG_WITH([openssl],
|
|
|
|
AC_HELP_STRING([--with-openssl],
|
|
|
|
[build unit tests with OpenSSL support]),
|
|
|
|
[],
|
|
|
|
[with_openssl=no])
|
|
|
|
AM_CONDITIONAL([WITH_OPENSSL], [test x"$with_openssl" = x"yes"])
|
|
|
|
|
|
|
|
# RSAREF versions of the unit tests for comparison
|
|
|
|
AC_ARG_WITH([rsaref],
|
|
|
|
AC_HELP_STRING([--with-rsaref],
|
|
|
|
[build unit tests with RSAREF support]),
|
|
|
|
[],
|
|
|
|
[with_rsaref=no])
|
|
|
|
AM_CONDITIONAL([WITH_RSAREF], [test x"$with_rsaref" = x"yes"])
|
|
|
|
|
2014-07-04 11:18:53 +00:00
|
|
|
# Developer-friendly compiler flags
|
|
|
|
AC_ARG_ENABLE([developer-warnings],
|
|
|
|
AS_HELP_STRING([--enable-developer-warnings],
|
|
|
|
[enable strict warnings (default is NO)]),
|
2014-12-20 00:27:20 +00:00
|
|
|
[CFLAGS="${CFLAGS} -Wall -Wextra -Wcast-qual"])
|
2014-07-04 11:18:53 +00:00
|
|
|
AC_ARG_ENABLE([debugging-symbols],
|
|
|
|
AS_HELP_STRING([--enable-debugging-symbols],
|
|
|
|
[enable debugging symbols (default is NO)]),
|
|
|
|
[CFLAGS="${CFLAGS} -O0 -g -fno-inline"])
|
|
|
|
AC_ARG_ENABLE([werror],
|
|
|
|
AS_HELP_STRING([--enable-werror],
|
|
|
|
[use -Werror (default is NO)]),
|
|
|
|
[CFLAGS="${CFLAGS} -Werror"])
|
|
|
|
|
2014-07-13 19:59:58 +00:00
|
|
|
############################################################################
|
|
|
|
#
|
|
|
|
# Output
|
|
|
|
#
|
2014-07-04 11:18:53 +00:00
|
|
|
|
|
|
|
AC_CONFIG_FILES([
|
|
|
|
Makefile
|
|
|
|
include/Makefile
|
|
|
|
include/cryb/Makefile
|
|
|
|
lib/Makefile
|
2015-10-03 14:24:59 +00:00
|
|
|
lib/cipher/Makefile
|
2014-07-04 11:18:53 +00:00
|
|
|
lib/core/Makefile
|
2014-08-01 14:18:25 +00:00
|
|
|
lib/cpe/Makefile
|
2014-07-04 11:18:53 +00:00
|
|
|
lib/digest/Makefile
|
|
|
|
lib/enc/Makefile
|
2014-07-19 06:03:57 +00:00
|
|
|
lib/hash/Makefile
|
2014-07-04 11:18:53 +00:00
|
|
|
lib/mac/Makefile
|
2014-08-12 07:30:31 +00:00
|
|
|
lib/mpi/Makefile
|
2014-07-04 11:18:53 +00:00
|
|
|
lib/oath/Makefile
|
|
|
|
lib/rand/Makefile
|
|
|
|
lib/rsaref/Makefile
|
|
|
|
t/Makefile
|
|
|
|
])
|
2014-12-20 02:58:11 +00:00
|
|
|
AC_CONFIG_FILES([mkpkgng], [chmod +x mkpkgng])
|
2014-12-20 00:52:37 +00:00
|
|
|
AC_CONFIG_FILES([tools/coverage.sh], [chmod +x tools/coverage.sh])
|
2014-07-04 11:18:53 +00:00
|
|
|
AC_OUTPUT
|