-
Notifications
You must be signed in to change notification settings - Fork 51
/
configure.ac
120 lines (104 loc) · 3.63 KB
/
configure.ac
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.68])
AC_INIT([emv-tools],[0.3],[[email protected]])
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_SRCDIR([lib/tlv.c])
AC_CONFIG_HEADERS([config.h])
m4_ifdef([AC_CONFIG_MACRO_DIRS],
[AC_CONFIG_MACRO_DIRS([m4 lib/m4])],
[AC_CONFIG_MACRO_DIR([lib/m4])
AC_CONFIG_MACRO_DIR([m4])])
AC_CANONICAL_TARGET
AM_INIT_AUTOMAKE([foreign -Wall -Werror])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES], [])
AM_MAINTAINER_MODE
# Checks for programs.
AC_PROG_CC
AM_PROG_CC_C_O
AC_PROG_RANLIB
AM_PROG_AR
LT_INIT([disable-shared])
AM_PROG_LEX
AC_PROG_YACC
PKG_PROG_PKG_CONFIG
PKG_CONFIG="${PKG_CONFIG} --static"
OPENEMV_CHECK_CFLAG([-Wall])
OPENEMV_CHECK_CFLAG([-Wmissing-prototypes])
OPENEMV_CHECK_CFLAG([-Wformat=2])
AC_ARG_ENABLE([gcov],
[AS_HELP_STRING([--enable-gcov],
[use Gcov to test the test suite])],
[enable_gcov=$enableval],
[enable_gcov=no])
AS_IF([test "x$enable_gcov" != "xno"],
[OPENEMV_CHECK_CFLAG([--coverage])
OPENEMV_CHECK_CFLAG([--no-inline])
OPENEMV_CHECK_CFLAG([-O0])])
m4_ifdef([AM_EXTRA_RECURSIVE_TARGETS],
[AM_EXTRA_RECURSIVE_TARGETS([gcov])],
[AC_MSG_WARN([Recursive gcov target will be unsupported due to old Automake])])
AM_CONDITIONAL([USE_GCOV], [test "x$enable_gcov" != "xno"])
AC_ARG_ENABLE([valgrind-tests],
[AS_HELP_STRING([--disable-valgrind-tests],
[do not run self tests under valgrind])],
[enable_valgrind=$enableval],
[enable_valgrind=yes])
AC_ARG_VAR([VALGRIND], [Valgrind command to use])
VALGRIND_OPTS="-q --error-exitcode=2 --leak-check=full"
AS_IF([test "x$enable_valgrind" != "xno"],
[AC_CACHE_CHECK([for valgrind tool], [ac_cv_path_VALGRIND],
[AC_PATH_PROGS_FEATURE_CHECK([VALGRIND], [valgrind],
[$ac_path_VALGRIND $VALGRIND_OPTS true \
&& ac_cv_path_VALGRIND="$ac_path_VALGRIND" ac_path_VALGRIND_found=:])])
AS_IF([test "x$ac_cv_path_VALGRIND" = "x"],
[AC_MSG_WARN([could not find Valgrind tool])],
[AC_SUBST([VALGRIND], ["$ac_cv_path_VALGRIND $VALGRIND_OPTS"])])])
# Checks for libraries.
PKG_CHECK_MODULES([CONFIG], [libconfig])
OPENEMV_PRIVATE_PKG([libconfig])
OPENEMV_MODULE([scard], [pcsc], [PCSC smart card interface], [yes],
[PKG_CHECK_MODULES([PCSC], [libpcsclite])
OPENEMV_PRIVATE_PKG([libpcsclite])])
OPENEMV_MODULE([scard], [emu], [emulated smart card interface], [no])
OPENEMV_MODULE([scard], [apduio], [APDUIO smart card interface], [no])
OPENEMV_MODULE([crypto], [libgcrypt], [libgcrypt crypto library], [yes],
[AM_PATH_LIBGCRYPT
OPENEMV_PRIVATE_LIBS([${LIBGCRYPT_LIBS}])])
OPENEMV_MODULE([crypto], [nettle], [nettle crypto library], [yes],
[PKG_CHECK_MODULES([NETTLE], [hogweed nettle])
OPENEMV_PRIVATE_PKG([hogweed, nettle])])
# Checks for header files.
AC_FUNC_ALLOCA
AC_CHECK_HEADERS([arpa/inet.h fcntl.h inttypes.h libintl.h malloc.h netinet/in.h stddef.h stdint.h stdlib.h string.h sys/socket.h unistd.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_STDBOOL
AC_C_INLINE
AC_TYPE_SIZE_T
AC_TYPE_SSIZE_T
AC_TYPE_INT8_T
AC_TYPE_INT16_T
AC_TYPE_INT32_T
AC_TYPE_UINT8_T
AC_TYPE_UINT16_T
AC_TYPE_UINT32_T
# Checks for library functions.
AC_FUNC_MALLOC
AC_FUNC_REALLOC
AC_CHECK_FUNCS([memset socket strdup])
AC_CHECK_FUNCS([getentropy])
pkgsysconfdir='${sysconfdir}/${PACKAGE}'
AC_SUBST([pkgsysconfdir])
AC_CONFIG_FILES([
Makefile
data/Makefile
lib/Makefile
lib/openemv.pc
lib/include/Makefile
lib/crypto/Makefile
lib/emu/Makefile
lib/scard/Makefile
src/Makefile
test/Makefile
])
AC_OUTPUT