cryb-to/configure.ac

175 lines
4.1 KiB
Text
Raw Normal View History

2014-07-04 11:18:53 +00:00
AC_PREREQ([2.63])
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])
############################################################################
#
# 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
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
############################################################################
#
# Headers and functions
#
2014-07-04 11:18:53 +00:00
AC_CHECK_HEADERS([endian.h sys/endian.h])
AC_CHECK_DECLS([
be16enc, be16dec, le16enc, le16dec,
be32enc, be32dec, le32enc, le32dec,
be64enc, be64dec, le64enc, le64dec
], [], [], [[
#if HAVE_SYS_ENDIAN_H
#include <sys/endian.h>
#endif
#if HAVE_ENDIAN_H
#include <endian.h>
#endif
]])
AC_CHECK_FUNCS([strlcat strlcmp strlcpy])
# 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>
#if HAVE_SYS_UIO_H
2014-10-30 13:07:16 +00:00
#include <sys/uio.h>
#endif
]])
AC_CHECK_FUNCS([utrace])
# 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])
############################################################################
#
# Extra libraries
#
save_LIBS="${LIBS}"
LIBS=""
AC_SEARCH_LIBS([clock_gettime], [rt])
RT_LIBS="${LIBS}"
LIBS="${save_LIBS}"
AC_SUBST(RT_LIBS)
############################################################################
#
# 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"])
############################################################################
#
# 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)]),
[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"])
############################################################################
#
# Output
#
2014-07-04 11:18:53 +00:00
AC_CONFIG_FILES([
Makefile
include/Makefile
include/cryb/Makefile
lib/Makefile
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
lib/hash/Makefile
2014-07-04 11:18:53 +00:00
lib/mac/Makefile
lib/mpi/Makefile
2014-07-04 11:18:53 +00:00
lib/oath/Makefile
lib/rand/Makefile
lib/rsaref/Makefile
t/Makefile
])
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