Build system overhaul

This commit is contained in:
Dag-Erling Smørgrav 2015-12-14 18:08:22 +01:00
parent 278ff6d113
commit f9c8ce7c65
11 changed files with 401 additions and 100 deletions

View file

@ -30,8 +30,9 @@ fi
. ./autogen.sh . ./autogen.sh
./configure \ ./configure \
--with-openssl \ --enable-all \
--with-rsaref \ --enable-openssl-tests \
--enable-rsaref-tests \
--enable-developer-warnings \ --enable-developer-warnings \
--enable-werror \ --enable-werror \
"$@" "$@"

View file

@ -80,57 +80,29 @@ AC_SUBST(RT_LIBS)
# #
# Documentation # Documentation
AC_ARG_WITH([doc], AC_ARG_ENABLE([doc],
AC_HELP_STRING([--without-doc], AC_HELP_STRING([--disable-doc],
[do not build the documentation]), [do not build the documentation]),
[], [],
[with_doc=yes]) [with_doc=yes])
AM_CONDITIONAL([WITH_DOC], [test x"$with_doc" = x"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 # Debugging
# #
# OpenSSL versions of the unit tests for comparison # OpenSSL versions of the unit tests for comparison
AC_ARG_WITH([openssl], AC_ARG_ENABLE([openssl-tests],
AC_HELP_STRING([--with-openssl], AC_HELP_STRING([--enable-openssl-tests],
[build unit tests with OpenSSL support]), [build unit tests with OpenSSL support]))
[], AM_CONDITIONAL([OPENSSL_TESTS], [test x"$enable_openssl_tests" = x"yes"])
[with_openssl=no])
AM_CONDITIONAL([WITH_OPENSSL], [test x"$with_openssl" = x"yes"])
# RSAREF versions of the unit tests for comparison # RSAREF versions of the unit tests for comparison
AC_ARG_WITH([rsaref], AC_ARG_ENABLE([rsaref-tests],
AC_HELP_STRING([--with-rsaref], AC_HELP_STRING([--enable-rsaref-tests],
[build unit tests with RSAREF support]), [build unit tests enable RSAREF support]))
[], AM_CONDITIONAL([RSAREF_TESTS], [test x"enable_rsaref_tests" = x"yes"])
[with_rsaref=no])
AM_CONDITIONAL([WITH_RSAREF], [test x"$with_rsaref" = x"yes"])
# Developer-friendly compiler flags # Developer-friendly compiler flags
AC_ARG_ENABLE([developer-warnings], AC_ARG_ENABLE([developer-warnings],
@ -146,6 +118,142 @@ AC_ARG_ENABLE([werror],
[use -Werror (default is NO)]), [use -Werror (default is NO)]),
[CFLAGS="${CFLAGS} -Werror"]) [CFLAGS="${CFLAGS} -Werror"])
############################################################################
#
# Components
#
# Everything
AC_ARG_ENABLE([all],
AC_HELP_STRING([--disable-all],
[disable all libraries and tools]),
[enable_all=$enableval],
[enable_all=yes])
# Ciphers
elements="$elements cipher"
requires="$requires cipher:core"
AC_ARG_ENABLE([cryb-cipher],
AC_HELP_STRING([--enable-cryb-cipher],
[build the cipher library]),
[enable_cryb_cipher=$enableval],
[enable_cryb_cipher=$enable_all])
AM_CONDITIONAL([CRYB_CIPHER], [test x"$enable_cryb_cipher" = x"yes"])
# CPE
elements="$elements cpe"
requires="$requires cpe:core"
AC_ARG_ENABLE([cryb-cpe],
AC_HELP_STRING([--enable-cryb-cpe],
[build the CPE library]),
[enable_cryb_cpe=$enableval],
[enable_cryb_cpe=$enable_all])
AM_CONDITIONAL([CRYB_CPE], [test x"$enable_cryb_cpe" = x"yes"])
# Core
elements="$elements core"
AC_ARG_ENABLE([cryb-core],
AC_HELP_STRING([--enable-cryb-core],
[build the core library]),
[enable_cryb_core=$enableval],
[enable_cryb_core=$enable_all])
AM_CONDITIONAL([CRYB_CORE], [test x"$enable_cryb_core" = x"yes"])
# Message digests
elements="$elements digest"
requires="$requires digests:core"
AC_ARG_ENABLE([cryb-digest],
AC_HELP_STRING([--enable-cryb-digest],
[build the message digest library]),
[enable_cryb_digest=$enableval],
[enable_cryb_digest=$enable_all])
AM_CONDITIONAL([CRYB_DIGEST], [test x"$enable_cryb_digest" = x"yes"])
# Encodings
elements="$elements enc"
requires="$requires env:core"
AC_ARG_ENABLE([cryb-enc],
AC_HELP_STRING([--enable-cryb-enc],
[build the encoding library]),
[enable_cryb_enc=$enableval],
[enable_cryb_enc=$enable_all])
AM_CONDITIONAL([CRYB_ENC], [test x"$enable_cryb_enc" = x"yes"])
# Non-cryptographic hashes
elements="$elements hash"
requires="$requires hash:core"
AC_ARG_ENABLE([cryb-hash],
AC_HELP_STRING([--enable-cryb-hash],
[build the non-cryptographic hash library]),
[enable_cryb_hash=$enableval],
[enable_cryb_hash=$enable_all])
AM_CONDITIONAL([CRYB_HASH], [test x"$enable_cryb_hash" = x"yes"])
# Message authentication codes
elements="$elements mac"
requires="$requires mac:core"
AC_ARG_ENABLE([cryb-mac],
AC_HELP_STRING([--enable-cryb-mac],
[build the message authentication code library]),
[enable_cryb_mac=$enableval],
[enable_cryb_mac=$enable_all])
AM_CONDITIONAL([CRYB_MAC], [test x"$enable_cryb_digest" = x"yes"])
# Multiple-precision integers
elements="$elements mpi"
requires="$requires mpi:core"
AC_ARG_ENABLE([cryb-mpi],
AC_HELP_STRING([--enable-cryb-mpi],
[build the multiple-precision math library]),
[enable_cryb_mpi=$enableval],
[enable_cryb_mpi=$enable_all])
AM_CONDITIONAL([CRYB_MPI], [test x"$enable_cryb_digest" = x"yes"])
# OATH
elements="$elements oath"
requires="$requires oath:core oath:digest oath:mac oath:enc"
AC_ARG_ENABLE([cryb-oath],
AC_HELP_STRING([--enable-cryb-oath],
[build the OATH library]),
[enable_cryb_oath=$enableval],
[enable_cryb_oath=$enable_all])
AM_CONDITIONAL([CRYB_OATH], [test x"$enable_cryb_oath" = x"yes"])
# Pseudo-randomness
elements="$elements rand"
requires="$requires rand:core"
AC_ARG_ENABLE([cryb-rand],
AC_HELP_STRING([--enable-cryb-rand],
[build the pseudo-randomness library]),
[enable_cryb_rand=$enableval],
[enable_cryb_rand=$enable_all])
AM_CONDITIONAL([CRYB_RAND], [test x"$enable_cryb_rand" = x"yes"])
# Test framework
elements="$elements test"
requires="$requires test:core"
AC_ARG_ENABLE([cryb-test],
AC_HELP_STRING([--enable-cryb-test],
[build the test framework]),
[enable_cryb_test=$enableval],
[enable_cryb_test=$enable_all])
AM_CONDITIONAL([CRYB_TEST], [test x"$enable_cryb_test" = x"yes"])
# Check dependencies
AC_MSG_CHECKING([dependencies])
for req in $requires ; do
lhs=${req%:*}
lhs_ena=`eval echo \\\$enable_cryb_$lhs`
if test x"$lhs_ena" = x"yes" ; then
rhs=${req#*:}
rhs_ena=`eval echo \\\$enable_cryb_$rhs`
if test x"$rhs_ena" != x"yes" ; then
AC_MSG_ERROR([cryb-$lhs requires cryb-$rhs])
fi
fi
done
AC_MSG_RESULT([ok])
############################################################################ ############################################################################
# #
# Output # Output
@ -173,3 +281,12 @@ AC_CONFIG_FILES([
AC_CONFIG_FILES([mkpkgng], [chmod +x mkpkgng]) AC_CONFIG_FILES([mkpkgng], [chmod +x mkpkgng])
AC_CONFIG_FILES([tools/coverage.sh], [chmod +x tools/coverage.sh]) AC_CONFIG_FILES([tools/coverage.sh], [chmod +x tools/coverage.sh])
AC_OUTPUT AC_OUTPUT
echo
echo The following Cryb components will be built:
echo
for elem in $elements ; do
enable=`eval echo \\\$enable_cryb_$elem`
printf "%16s: %s\n" $elem ${enable:-no}
done
echo

View file

@ -1,51 +1,108 @@
crybdir = $(includedir)/cryb crybdir = $(includedir)/cryb
cryb_HEADERS = \ cryb_HEADERS =
if CRYB_CIPHER
cryb_HEADERS += \
aes.h \ aes.h \
rc4.h \
\
cipher.h
endif CRYB_CIPHER
if CRYB_CORE
cryb_HEADERS += \
algorithm.h \ algorithm.h \
attributes.h \ attributes.h \
bitwise.h \ bitwise.h \
cipher.h \
cpe.h \
ctype.h \ ctype.h \
digest.h \
endian.h \ endian.h \
hash.h \ memset_s.h \
hmac.h \ string.h \
hmac_sha1.h \ strlcat.h \
hmac_sha224.h \ strlcmp.h \
hmac_sha256.h \ strlcpy.h \
hmac_sha384.h \ version.h \
hmac_sha512.h \ wstring.h \
hotp.h \ \
to.h
endif CRYB_CORE
if CRYB_CPE
cryb_HEADERS += \
\
cpe.h
endif CRYB_CPE
if CRYB_DIGEST
cryb_HEADERS += \
md.h \ md.h \
md2.h \ md2.h \
md4.h \ md4.h \
md5.h \ md5.h \
memset_s.h \
mpi.h \
oath.h \
oath_constants.h \
oath_types.h \
rand.h \
rc4.h \
rfc3986.h \
rfc4648.h \
sha.h \ sha.h \
sha1.h \ sha1.h \
sha224.h \ sha224.h \
sha256.h \ sha256.h \
sha384.h \ sha384.h \
sha512.h \ sha512.h \
string.h \ \
strlcat.h \ digest.h
strlcmp.h \ endif CRYB_DIGEST
strlcpy.h \
test.h \ if CRYB_ENC
to.h \ cryb_HEADERS += \
rfc3986.h \
rfc4648.h \
\
enc.h
endif CRYB_ENC
if CRYB_HASH
cryb_HEADERS += \
\
hash.h
endif CRYB_HASH
if CRYB_MAC
cryb_HEADERS += \
hmac.h \
hmac_sha1.h \
hmac_sha224.h \
hmac_sha256.h \
hmac_sha384.h \
hmac_sha512.h \
\
mac.h
endif CRYB_MAC
if CRYB_MPI
cryb_HEADERS += \
\
mpi.h
endif CRYB_MPI
if CRYB_OATH
cryb_HEADERS += \
hotp.h \
oath_constants.h \
oath_types.h \
totp.h \ totp.h \
version.h \ \
wstring.h oath.h
endif CRYB_OATH
if CRYB_RAND
cryb_HEADERS += \
\
rand.h
endif CRYB_RAND
if CRYB_TEST
cryb_HEADERS += \
\
test.h
endif CRYB_TEST
noinst_HEADERS = \ noinst_HEADERS = \
coverage.h \ coverage.h \

36
include/cryb/enc.h Normal file
View file

@ -0,0 +1,36 @@
/*-
* Copyright (c) 2015 Dag-Erling Smørgrav
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote
* products derived from this software without specific prior written
* permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#ifndef CRYB_ENC_H_INCLUDED
#define CRYB_ENC_H_INCLUDED
#include <cryb/rfc3986.h>
#include <cryb/rfc4648.h>
#endif

35
include/cryb/mac.h Normal file
View file

@ -0,0 +1,35 @@
/*-
* Copyright (c) 2015 Dag-Erling Smørgrav
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote
* products derived from this software without specific prior written
* permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#ifndef CRYB_MAC_H_INCLUDED
#define CRYB_MAC_H_INCLUDED
#include <cryb/hmac.h>
#endif

View file

@ -30,4 +30,6 @@
#ifndef CRYB_TO_H_INCLUDED #ifndef CRYB_TO_H_INCLUDED
#define CRYB_TO_H_INCLUDED #define CRYB_TO_H_INCLUDED
#include <cryb/version.h>
#endif #endif

View file

@ -1,5 +1,5 @@
/*- /*-
* Copyright (c) 2014 Dag-Erling Smørgrav * Copyright (c) 2014-2015 Dag-Erling Smørgrav
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -30,6 +30,6 @@
#ifndef CRYB_VERSION_H_INCLUDED #ifndef CRYB_VERSION_H_INCLUDED
#define CRYB_VERSION_H_INCLUDED #define CRYB_VERSION_H_INCLUDED
#define CRYB_VERSION 20140311 #define CRYB_VERSION 20151214
#endif #endif

View file

@ -1,16 +1,49 @@
SUBDIRS = \ SUBDIRS =
cipher \
core \
cpe \
digest \
enc \
hash \
mac \
mpi \
oath \
rand \
test
if WITH_RSAREF if CRYB_CIPHER
SUBDIRS += cipher
endif CRYB_CIPHER
if CRYB_CORE
SUBDIRS += core
endif CRYB_CORE
if CRYB_CPE
SUBDIRS += cpe
endif CRYB_CPE
if CRYB_DIGEST
SUBDIRS += digest
endif CRYB_DIGEST
if CRYB_ENC
SUBDIRS += enc
endif CRYB_ENC
if CRYB_HASH
SUBDIRS += hash
endif CRYB_HASH
if CRYB_MAC
SUBDIRS += mac
endif CRYB_MAC
if CRYB_MPI
SUBDIRS += mpi
endif CRYB_MPI
if CRYB_OATH
SUBDIRS += oath
endif CRYB_OATH
if CRYB_RAND
SUBDIRS += rand
endif CRYB_RAND
if CRYB_TEST
SUBDIRS += test
endif CRYB_TEST
if RSAREF_TESTS
SUBDIRS += rsaref SUBDIRS += rsaref
endif endif RSAREF_TESTS

View file

@ -7,3 +7,6 @@ libcryb_cpe_la_SOURCES = \
cpe_string.c \ cpe_string.c \
cpe_uri.c \ cpe_uri.c \
cpe_wfn.c cpe_wfn.c
libcryb_cpe_la_LIBADD = \
$(top_builddir)/lib/core/libcryb-core.la

View file

@ -14,5 +14,6 @@ libcryb_oath_la_SOURCES = \
libcryb_oath_la_LIBADD = \ libcryb_oath_la_LIBADD = \
$(top_builddir)/lib/digest/libcryb-digest.la \ $(top_builddir)/lib/digest/libcryb-digest.la \
$(top_builddir)/lib/enc/libcryb-enc.la \
$(top_builddir)/lib/mac/libcryb-mac.la \ $(top_builddir)/lib/mac/libcryb-mac.la \
$(top_builddir)/lib/enc/libcryb-enc.la $(top_builddir)/lib/core/libcryb-core.la

View file

@ -2,6 +2,8 @@ AM_CPPFLAGS = -I$(top_srcdir)/include
EXTRA_DIST = EXTRA_DIST =
if CRYB_TEST
# Individual libraries # Individual libraries
libcipher = $(top_builddir)/lib/cipher/libcryb-cipher.la libcipher = $(top_builddir)/lib/cipher/libcryb-cipher.la
libcore = $(top_builddir)/lib/core/libcryb-core.la libcore = $(top_builddir)/lib/core/libcryb-core.la
@ -15,28 +17,31 @@ librand = $(top_builddir)/lib/rand/libcryb-rand.la
libt = $(top_builddir)/lib/test/libcryb-test.la libt = $(top_builddir)/lib/test/libcryb-test.la
# Additional headers, flags and libraries for OpenSSL # Additional headers, flags and libraries for OpenSSL
if WITH_OPENSSL if OPENSSL_TESTS
OPENSSL_INCLUDES = $(INCLUDES) OPENSSL_INCLUDES = $(INCLUDES)
OPENSSL_CFLAGS = -DWITH_OPENSSL=1 OPENSSL_CFLAGS = -DWITH_OPENSSL=1
OPENSSL_LDADD = -lcrypto OPENSSL_LDADD = -lcrypto
endif endif OPENSSL_TESTS
# Additional headers, flags and libraries for RSAREF # Additional headers, flags and libraries for RSAREF
if WITH_RSAREF if RSAREF_TESTS
RSAREF_INCLUDES = $(INCLUDES) -I$(top_srcdir)/lib/rsaref RSAREF_INCLUDES = $(INCLUDES) -I$(top_srcdir)/lib/rsaref
RSAREF_CFLAGS = -DWITH_RSAREF=1 -DPROTOTYPES=1 RSAREF_CFLAGS = -DWITH_RSAREF=1 -DPROTOTYPES=1
RSAREF_LDADD = $(top_builddir)/lib/rsaref/librsaref.la RSAREF_LDADD = $(top_builddir)/lib/rsaref/librsaref.la
endif endif RSAREF_TESTS
# tests # tests
TESTS = TESTS =
# libcryb-cipher # libcryb-cipher
if CRYB_CIPHER
TESTS += t_aes t_rc4 TESTS += t_aes t_rc4
t_aes_LDADD = $(libt) $(libcipher) t_aes_LDADD = $(libt) $(libcipher)
t_rc4_LDADD = $(libt) $(libcipher) t_rc4_LDADD = $(libt) $(libcipher)
endif CRYB_CIPHER
# libcryb-core # libcryb-core
if CRYB_CORE
TESTS += t_ctype t_endian t_memset_s t_strlcat t_strlcmp t_strlcpy TESTS += t_ctype t_endian t_memset_s t_strlcat t_strlcmp t_strlcpy
TESTS += t_string t_wstring TESTS += t_string t_wstring
EXTRA_DIST += t__string.c EXTRA_DIST += t__string.c
@ -48,18 +53,22 @@ t_strlcmp_LDADD = $(libt) $(libcore)
t_strlcpy_LDADD = $(libt) $(libcore) t_strlcpy_LDADD = $(libt) $(libcore)
t_string_LDADD = $(libt) $(libcore) t_string_LDADD = $(libt) $(libcore)
t_wstring_LDADD = $(libt) $(libcore) t_wstring_LDADD = $(libt) $(libcore)
endif CRYB_CORE
# libcryb-enc # libcryb-enc
if CRYB_ENC
TESTS += t_rfc3986 t_rfc4648 TESTS += t_rfc3986 t_rfc4648
t_rfc3986_LDADD = $(libt) $(libenc) t_rfc3986_LDADD = $(libt) $(libenc)
t_rfc4648_LDADD = $(libt) $(libenc) t_rfc4648_LDADD = $(libt) $(libenc)
endif CRYB_ENC
# libcryb-digest # libcryb-digest
if CRYB_DIGEST
TESTS += t_md2 t_md4 t_md5 TESTS += t_md2 t_md4 t_md5
t_md2_LDADD = $(libt) $(libdigest) $(RT_LIBS) t_md2_LDADD = $(libt) $(libdigest) $(RT_LIBS)
t_md4_LDADD = $(libt) $(libdigest) $(RT_LIBS) t_md4_LDADD = $(libt) $(libdigest) $(RT_LIBS)
t_md5_LDADD = $(libt) $(libdigest) $(RT_LIBS) t_md5_LDADD = $(libt) $(libdigest) $(RT_LIBS)
if WITH_OPENSSL if OPENSSL_TESTS
TESTS += t_md4_openssl t_md5_openssl TESTS += t_md4_openssl t_md5_openssl
t_md4_openssl_SOURCES = t_md4.c t_md4_openssl_SOURCES = t_md4.c
t_md4_openssl_CFLAGS = $(OPENSSL_INCLUDES) $(OPENSSL_CFLAGS) t_md4_openssl_CFLAGS = $(OPENSSL_INCLUDES) $(OPENSSL_CFLAGS)
@ -67,8 +76,8 @@ t_md4_openssl_LDADD = $(libt) $(OPENSSL_LDADD) $(RT_LIBS)
t_md5_openssl_SOURCES = t_md5.c t_md5_openssl_SOURCES = t_md5.c
t_md5_openssl_CFLAGS = $(OPENSSL_INCLUDES) $(OPENSSL_CFLAGS) t_md5_openssl_CFLAGS = $(OPENSSL_INCLUDES) $(OPENSSL_CFLAGS)
t_md5_openssl_LDADD = $(libt) $(OPENSSL_LDADD) $(RT_LIBS) t_md5_openssl_LDADD = $(libt) $(OPENSSL_LDADD) $(RT_LIBS)
endif endif OPENSSL_TESTS
if WITH_RSAREF if RSAREF_TESTS
TESTS += t_md2_rsaref t_md5_rsaref TESTS += t_md2_rsaref t_md5_rsaref
t_md2_rsaref_SOURCES = t_md2.c t_md2_rsaref_SOURCES = t_md2.c
t_md2_rsaref_CFLAGS = $(RSAREF_INCLUDES) $(RSAREF_CFLAGS) t_md2_rsaref_CFLAGS = $(RSAREF_INCLUDES) $(RSAREF_CFLAGS)
@ -76,15 +85,14 @@ t_md2_rsaref_LDADD = $(libt) $(RSAREF_LDADD) $(RT_LIBS)
t_md5_rsaref_SOURCES = t_md5.c t_md5_rsaref_SOURCES = t_md5.c
t_md5_rsaref_CFLAGS = $(RSAREF_INCLUDES) $(RSAREF_CFLAGS) t_md5_rsaref_CFLAGS = $(RSAREF_INCLUDES) $(RSAREF_CFLAGS)
t_md5_rsaref_LDADD = $(libt) $(RSAREF_LDADD) $(RT_LIBS) t_md5_rsaref_LDADD = $(libt) $(RSAREF_LDADD) $(RT_LIBS)
endif endif RSAREF_TESTS
TESTS += t_sha1 t_sha224 t_sha256 t_sha384 t_sha512 TESTS += t_sha1 t_sha224 t_sha256 t_sha384 t_sha512
t_sha1_LDADD = $(libt) $(libdigest) $(RT_LIBS) t_sha1_LDADD = $(libt) $(libdigest) $(RT_LIBS)
t_sha224_LDADD = $(libt) $(libdigest) $(RT_LIBS) t_sha224_LDADD = $(libt) $(libdigest) $(RT_LIBS)
t_sha256_LDADD = $(libt) $(libdigest) $(RT_LIBS) t_sha256_LDADD = $(libt) $(libdigest) $(RT_LIBS)
t_sha384_LDADD = $(libt) $(libdigest) $(RT_LIBS) t_sha384_LDADD = $(libt) $(libdigest) $(RT_LIBS)
t_sha512_LDADD = $(libt) $(libdigest) $(RT_LIBS) t_sha512_LDADD = $(libt) $(libdigest) $(RT_LIBS)
if WITH_OPENSSL if OPENSSL_TESTS
TESTS += t_sha1_openssl t_sha224_openssl t_sha256_openssl t_sha384_openssl t_sha512_openssl TESTS += t_sha1_openssl t_sha224_openssl t_sha256_openssl t_sha384_openssl t_sha512_openssl
t_sha1_openssl_SOURCES = t_sha1.c t_sha1_openssl_SOURCES = t_sha1.c
t_sha1_openssl_CFLAGS = $(OPENSSL_INCLUDES) $(OPENSSL_CFLAGS) t_sha1_openssl_CFLAGS = $(OPENSSL_INCLUDES) $(OPENSSL_CFLAGS)
@ -101,24 +109,27 @@ t_sha384_openssl_LDADD = $(libt) $(OPENSSL_LDADD) $(RT_LIBS)
t_sha512_openssl_SOURCES = t_sha512.c t_sha512_openssl_SOURCES = t_sha512.c
t_sha512_openssl_CFLAGS = $(OPENSSL_INCLUDES) $(OPENSSL_CFLAGS) t_sha512_openssl_CFLAGS = $(OPENSSL_INCLUDES) $(OPENSSL_CFLAGS)
t_sha512_openssl_LDADD = $(libt) $(OPENSSL_LDADD) $(RT_LIBS) t_sha512_openssl_LDADD = $(libt) $(OPENSSL_LDADD) $(RT_LIBS)
endif endif OPENSSL_TESTS
endif CRYB_DIGEST
# libcryb-hash # libcryb-hash
if CRYB_HASH
TESTS += t_adler t_fletcher t_murmur3_32 t_pearson TESTS += t_adler t_fletcher t_murmur3_32 t_pearson
t_adler_LDADD = $(libt) $(libhash) t_adler_LDADD = $(libt) $(libhash)
t_fletcher_LDADD = $(libt) $(libhash) t_fletcher_LDADD = $(libt) $(libhash)
t_murmur3_32_LDADD = $(libt) $(libhash) t_murmur3_32_LDADD = $(libt) $(libhash)
t_pearson_LDADD = $(libt) $(libhash) t_pearson_LDADD = $(libt) $(libhash)
endif CRYB_HASH
# libcryb-mac # libcryb-mac
if CRYB_MAC
TESTS += t_hmac_sha1 t_hmac_sha224 t_hmac_sha256 t_hmac_sha384 t_hmac_sha512 TESTS += t_hmac_sha1 t_hmac_sha224 t_hmac_sha256 t_hmac_sha384 t_hmac_sha512
t_hmac_sha1_LDADD = $(libt) $(libmac) t_hmac_sha1_LDADD = $(libt) $(libmac)
t_hmac_sha224_LDADD = $(libt) $(libmac) t_hmac_sha224_LDADD = $(libt) $(libmac)
t_hmac_sha256_LDADD = $(libt) $(libmac) t_hmac_sha256_LDADD = $(libt) $(libmac)
t_hmac_sha384_LDADD = $(libt) $(libmac) t_hmac_sha384_LDADD = $(libt) $(libmac)
t_hmac_sha512_LDADD = $(libt) $(libmac) t_hmac_sha512_LDADD = $(libt) $(libmac)
if OPENSSL_TESTS
if WITH_OPENSSL
TESTS += t_hmac_sha1_openssl t_hmac_sha224_openssl t_hmac_sha256_openssl t_hmac_sha384_openssl t_hmac_sha512_openssl TESTS += t_hmac_sha1_openssl t_hmac_sha224_openssl t_hmac_sha256_openssl t_hmac_sha384_openssl t_hmac_sha512_openssl
t_hmac_sha1_openssl_SOURCES = t_hmac_sha1.c t_hmac_sha1_openssl_SOURCES = t_hmac_sha1.c
t_hmac_sha1_openssl_CFLAGS = $(OPENSSL_INCLUDES) $(OPENSSL_CFLAGS) t_hmac_sha1_openssl_CFLAGS = $(OPENSSL_INCLUDES) $(OPENSSL_CFLAGS)
@ -135,10 +146,15 @@ t_hmac_sha384_openssl_LDADD = $(libt) $(OPENSSL_LDADD)
t_hmac_sha512_openssl_SOURCES = t_hmac_sha512.c t_hmac_sha512_openssl_SOURCES = t_hmac_sha512.c
t_hmac_sha512_openssl_CFLAGS = $(OPENSSL_INCLUDES) $(OPENSSL_CFLAGS) t_hmac_sha512_openssl_CFLAGS = $(OPENSSL_INCLUDES) $(OPENSSL_CFLAGS)
t_hmac_sha512_openssl_LDADD = $(libt) $(OPENSSL_LDADD) t_hmac_sha512_openssl_LDADD = $(libt) $(OPENSSL_LDADD)
endif endif OPENSSL_TESTS
endif CRYB_MAC
# libcryb-mpi # libcryb-mpi
if CRYB_MPI
TESTS += t_mpi TESTS += t_mpi
t_mpi_LDADD = $(libt) $(libmpi) t_mpi_LDADD = $(libt) $(libmpi)
endif CRYB_MPI
check_PROGRAMS = $(TESTS) check_PROGRAMS = $(TESTS)
endif CRYB_TEST