# Automake makefile for krb5-strength.
#
# Written by Russ Allbery <eagle@eyrie.org>
+# Copyright 2016 Russ Allbery <eagle@eyrie.org>
# Copyright 2007, 2009, 2010, 2012, 2013, 2014
# The Board of Trustees of the Leland Stanford Junior University
#
# See LICENSE for licensing terms.
ACLOCAL_AMFLAGS = -I m4
-EXTRA_DIST = .gitignore LICENSE autogen cracklib/HISTORY cracklib/LICENCE \
- cracklib/README cracklib/genrules.pl cracklib/mkdict tests/HOWTO \
- tests/TESTS tests/data/krb5.conf tests/data/make-krb5-conf \
- tests/data/passwords tests/data/perl.conf tests/data/perlcriticrc \
- tests/data/perltidyrc tests/data/valgrind.supp tests/data/wordlist \
- tests/data/wordlist.cdb tests/data/wordlist.sqlite \
- tests/docs/pod-spelling-t tests/docs/pod-t tests/perl/critic-t \
- tests/perl/minimum-version-t tests/perl/strict-t \
- tests/tap/libtap.sh tests/tap/perl/Test/RRA.pm \
- tests/tap/perl/Test/RRA/Config.pm \
- tests/tap/perl/Test/RRA/Automake.pm tests/tools/heimdal-history-t \
- tests/tools/heimdal-strength-t tests/tools/wordlist-cdb-t \
- tests/tools/wordlist-sqlite-t tests/tools/wordlist-t \
+EXTRA_DIST = .gitignore .travis.yml LICENSE bootstrap cracklib/HISTORY \
+ cracklib/LICENCE cracklib/README cracklib/genrules.pl \
+ cracklib/mkdict tests/HOWTO tests/TESTS tests/data/krb5.conf \
+ tests/data/make-krb5-conf tests/data/passwords tests/data/perl.conf \
+ tests/data/perlcriticrc tests/data/perltidyrc \
+ tests/data/valgrind.supp tests/data/wordlist \
+ tests/data/wordlist.cdb tests/data/wordlist.sqlite \
+ tests/docs/pod-spelling-t tests/docs/pod-t tests/perl/critic-t \
+ tests/perl/minimum-version-t tests/perl/strict-t \
+ tests/tap/libtap.sh tests/tap/perl/Test/RRA.pm \
+ tests/tap/perl/Test/RRA/Config.pm \
+ tests/tap/perl/Test/RRA/Automake.pm tests/tools/heimdal-history-t \
+ tests/tools/heimdal-strength-t tests/tools/wordlist-cdb-t \
+ tests/tools/wordlist-sqlite-t tests/tools/wordlist-t \
tests/util/xmalloc-t tools/heimdal-strength.pod
# Do this globally. Everything needs to find the Kerberos headers and
maintainer-clean-local:
rm -f tests/data/passwords/*.c
-# A set of flags for warnings. Add -O because gcc won't find some warnings
-# without optimization turned on. Desirable warnings that can't be turned
-# on due to other problems:
-#
-# -Wconversion http://bugs.debian.org/488884 (htons warnings)
-#
-# Last checked against gcc 4.7.2 (2013-04-22). -D_FORTIFY_SOURCE=2 enables
-# warn_unused_result attribute markings on glibc functions on Linux, which
-# catches a few more issues.
-WARNINGS = -g -O -D_FORTIFY_SOURCE=2 -Wall -Wextra -Wendif-labels \
- -Wformat=2 -Winit-self -Wswitch-enum -Wuninitialized -Wfloat-equal \
- -Wdeclaration-after-statement -Wshadow -Wpointer-arith \
- -Wbad-function-cast -Wcast-align -Wwrite-strings \
- -Wjump-misses-init -Wlogical-op -Wstrict-prototypes \
- -Wold-style-definition -Wmissing-prototypes -Wnormalized=nfc \
- -Wpacked -Wredundant-decls -Wnested-externs -Winline -Wvla -Werror
-
warnings:
- $(MAKE) V=0 CFLAGS='$(WARNINGS)'
- $(MAKE) V=0 CFLAGS='$(WARNINGS)' $(check_PROGRAMS)
+ $(MAKE) V=0 CFLAGS='$(WARNINGS_CFLAGS) $(AM_CFLAGS)' \
+ KRB5_CPPFLAGS='$(KRB5_CPPFLAGS_GCC)'
+ $(MAKE) V=0 CFLAGS='$(WARNINGS_CFLAGS) $(AM_CFLAGS)' \
+ KRB5_CPPFLAGS='$(KRB5_CPPFLAGS_GCC)' $(check_PROGRAMS)
# The bits below are for the test suite, not for the main package.
-check_PROGRAMS = tests/runtests tests/plugin/heimdal-t tests/plugin/mit-t \
- tests/portable/asprintf-t tests/portable/mkstemp-t \
- tests/portable/snprintf-t tests/portable/strndup-t \
- tests/util/messages-krb5-t tests/util/messages-t tests/util/xmalloc
+check_PROGRAMS = tests/runtests tests/plugin/heimdal-t tests/plugin/mit-t \
+ tests/portable/asprintf-t tests/portable/mkstemp-t \
+ tests/portable/reallocarray-t tests/portable/snprintf-t \
+ tests/portable/strndup-t tests/util/messages-krb5-t \
+ tests/util/messages-t tests/util/xmalloc
if EMBEDDED_CRACKLIB
check_PROGRAMS += cracklib/packer
endif
-tests_runtests_CPPFLAGS = -DSOURCE='"$(abs_top_srcdir)/tests"' \
- -DBUILD='"$(abs_top_builddir)/tests"'
+tests_runtests_CPPFLAGS = -DC_TAP_SOURCE='"$(abs_top_srcdir)/tests"' \
+ -DC_TAP_BUILD='"$(abs_top_builddir)/tests"'
check_LIBRARIES = tests/tap/libtap.a
tests_tap_libtap_a_CPPFLAGS = -I$(abs_top_srcdir)/tests $(KRB5_CPPFLAGS)
tests_tap_libtap_a_SOURCES = tests/tap/basic.c tests/tap/basic.h \
tests_portable_mkstemp_t_SOURCES = tests/portable/mkstemp-t.c \
tests/portable/mkstemp.c
tests_portable_mkstemp_t_LDADD = tests/tap/libtap.a portable/libportable.la
+tests_portable_reallocarray_t_SOURCES = tests/portable/reallocarray-t.c \
+ tests/portable/reallocarray.c
+tests_portable_reallocarray_t_LDADD = tests/tap/libtap.a \
+ portable/libportable.la
tests_portable_snprintf_t_SOURCES = tests/portable/snprintf-t.c \
tests/portable/snprintf.c
tests_portable_snprintf_t_LDADD = tests/tap/libtap.a portable/libportable.la
# Used by maintainers to run the main test suite under valgrind. Suppress
# the xmalloc and pod-spelling tests because the former won't work properly
# under valgrind (due to increased memory usage) and the latter is pointless
-# to run under valgrind. Don't try to trace the test for
-# krb5-strength-wordlist, since it's pure Perl.
+# to run under valgrind. Don't try to trace several of the tests that are
+# written in Perl or shell and test Perl programs.
check-valgrind: $(check_PROGRAMS) tests/data/dictionary.pwd
rm -rf $(abs_top_builddir)/tmp-valgrind
mkdir $(abs_top_builddir)/tmp-valgrind
- env RRA_MAINTAINER_TESTS= valgrind --leak-check=full \
- --show-reachable=yes --trace-children=yes \
- --log-file=$(abs_top_builddir)/tmp-valgrind/log.%p \
- --suppressions=tests/data/valgrind.supp \
- --trace-children-skip="/bin/sh,*/cat,*/diff,*/expr,*/grep,*/mkdir,*/rm,*/rmdir,*/sed,*/sleep,*/true,*/wc,*/docs/*-t,*/perl/*-t,*/data/make-krb5-conf,*/tools/wordlist-*-t" \
+ env RRA_MAINTAINER_TESTS= valgrind --leak-check=full \
+ --show-reachable=yes --trace-children=yes \
+ --log-file=$(abs_top_builddir)/tmp-valgrind/log.%p \
+ --suppressions=$(abs_top_srcdir)/tests/data/valgrind.supp \
+ --trace-children-skip="/bin/sh,*/cat,*/diff,*/expr,*/grep,*/mkdir,*/rm,*/rmdir,*/sed,*/sleep,*/true,*/wc,*/docs/*-t,*/perl/*-t,*/data/make-krb5-conf,*/tools/heimdal-history-t,*/tools/wordlist*-t" \
tests/runtests -l '$(abs_top_srcdir)/tests/TESTS'