Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use more automagic #1412

Merged
merged 4 commits into from
May 17, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
89 changes: 0 additions & 89 deletions .gitignore

This file was deleted.

1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ install:
- sha256sum autoconf-archive-2019.01.06.tar.xz | grep -q 17195c833098da79de5778ee90948f4c5d90ed1a0cf8391b4ab348e2ec511e3f || travis_terminate 1
- tar xJf autoconf-archive-2019.01.06.tar.xz
- cp autoconf-archive-2019.01.06/m4/ax_code_coverage.m4 m4/
- cp autoconf-archive-2019.01.06/m4/ax_is_release.m4 m4/
- cp autoconf-archive-2019.01.06/m4/ax_prog_doxygen.m4 m4/
# IBM-TPM
- wget https://download.01.org/tpm2/ibmtpm974.tar.gz
Expand Down
2 changes: 1 addition & 1 deletion Makefile-fuzz.am
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ test_fuzz_libfuzz_utils_la_SOURCES = \
test/integration/sapi-test-options.c

TESTS_LDADD += $(libtss2_utils_fuzzing)
FUZZ_LDADD = $(TESTS_LDADD) $(TESTS_LDFLAGS) $(FUZZ_LDFLAGS)
FUZZLDADD = $(TESTS_LDADD) $(TESTS_LDFLAGS) $(FUZZ_LDFLAGS)

fuzzdir = $(srcdir)
fuzz-targets: $(fuzz_PROGRAMS)
Expand Down
27 changes: 27 additions & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
# Copyright (c) 2018 Fraunhofer SIT sponsored by Infineon Technologies AG
# All rights reserved.

-include $(top_srcdir)/git.mk

### Initialize global variables used throughout the file ###
INCLUDE_DIRS = -I$(srcdir)/src -I$(srcdir)/include/tss2
ACLOCAL_AMFLAGS = -I m4 --install
Expand All @@ -17,6 +19,31 @@ DISTCLEANFILES =
CLEANFILES =
MOSTLYCLEANFILES =
noinst_PROGRAMS =
MAINTAINERCLEANFILES = \
$(GITIGNORE_MAINTAINERCLEANFILES_TOPLEVEL) \
$(GITIGNORE_MAINTAINERCLEANFILES_MAKEFILE_IN) \
$(GITIGNORE_MAINTAINERCLEANFILES_M4_LIBTOOL) \
src_vars.mk \
Makefile-fuzz-generated.am \
aminclude_static.am \
m4/ax_ac_append_to_file.m4 \
m4/ax_ac_print_to_file.m4 \
m4/ax_add_am_macro_static.m4 \
m4/ax_add_fortify_source.m4 \
m4/ax_am_macros_static.m4 \
m4/ax_check_compile_flag.m4 \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On my system, the otherwise untracked m4/ax_check_gnu_make.m4 needs to be added to MAINTAINERCLEANFILES.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll add that as well...

m4/ax_check_enable_debug.m4 \
m4/ax_check_gnu_make.m4 \
m4/ax_check_link_flag.m4 \
m4/ax_check_preproc_flag.m4 \
m4/ax_code_coverage.m4 \
m4/ax_file_escapes.m4 \
m4/ax_is_release.m4 \
m4/ax_normalize_path.m4 \
m4/ax_prog_doxygen.m4 \
m4/ax_valgrind_check.m4 \
m4/pkg.m4 \
$(DIST_ARCHIVES)

### Add ax_* rules ###
# ax_code_coverage
Expand Down
22 changes: 9 additions & 13 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ AC_INIT([tpm2-tss],
[],
[https://github.com/tpm2-software/tpm2-tss])
AC_CONFIG_MACRO_DIR([m4])
AC_PROG_CXX
AC_PROG_CC
LT_INIT()
PKG_INSTALLDIR()
AM_INIT_AUTOMAKE([foreign
subdir-objects])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) #Backward compatible setting of "silent-rules"
Expand All @@ -26,6 +22,14 @@ AC_SUBST([DISTCHECK_CONFIGURE_FLAGS],[$ac_configure_args])

AC_CANONICAL_HOST

AX_IS_RELEASE(dash-version)
AX_CHECK_ENABLE_DEBUG([info])

AC_PROG_CXX
AC_PROG_CC
LT_INIT()
PKG_INSTALLDIR()

# Check OS and set library and compile flags accordingly
case "${host_os}" in
*nto-qnx*)
Expand Down Expand Up @@ -227,11 +231,6 @@ AS_CASE(["x$with_maxloglevel"],
[AC_DEFINE_UNQUOTED([MAXLOGLEVEL], [6], ["Trace log level"])],
[AC_MSG_ERROR([Bad value for --with-maxloglevel])])

AC_ARG_ENABLE([debug],
[AS_HELP_STRING([--enable-debug],
[build with debug info])],,
[enable_debug=no])
AS_IF([test "x$enable_debug" = "xyes"], ADD_COMPILER_FLAG([-ggdb3 -Og]))
AC_ARG_ENABLE([defaultflags],
[AS_HELP_STRING([--disable-defaultflags],
[Disable default preprocessor, compiler, and linker flags.])],,
Expand All @@ -242,10 +241,7 @@ AS_IF([test "x$enable_defaultflags" = "xyes"],
ADD_PREPROC_FLAG([-D_BSD_SOURCE])
ADD_PREPROC_FLAG([-D_POSIX_SOURCE])
AS_IF([test "x$enable_debug" = "xno"],
[
ADD_PREPROC_FLAG([-U_FORTIFY_SOURCE])
ADD_PREPROC_FLAG([-D_FORTIFY_SOURCE=2])
])
[AX_ADD_FORTIFY_SOURCE])
ADD_COMPILER_FLAG([-std=c99])
ADD_COMPILER_FLAG([-Wall])
ADD_COMPILER_FLAG([-Wextra])
Expand Down