Debian Codegraph @

configure.ac

raw
1 dnl KCAPI_MAJVERSION API / ABI incompatible changes, functional
2 dnl changes that require consumer to be updated
3 dnl (as long as this number is zero, the API is
4 dnl not considered stable and can change without
5 dnl a bump of the major version)
6 dnl KCAPI_MINVERSION API compatible, ABI may change, functional
7 dnl enhancements only, consumer can be left
8 dnl unchanged if enhancements are not considered
9 dnl KCAPI_PATCHLEVEL API / ABI compatible, no functional changes, no
10 dnl enhancements, bug fixes only. Versions with
11 dnl a decimal point are pre-releases.
12 m4_define([__KCAPI_MAJVERSION], [1])
13 m4_define([__KCAPI_MINVERSION], [4])
14 m4_define([__KCAPI_PATCHLEVEL], [0])
15 m4_define([KCAPI_VERSION], [__KCAPI_MAJVERSION.__KCAPI_MINVERSION.__KCAPI_PATCHLEVEL])
16
17 AC_INIT([libkcapi], [KCAPI_VERSION])
18 AC_DEFINE([KCAPI_MAJVERSION], [__KCAPI_MAJVERSION])
19 AC_DEFINE([KCAPI_MINVERSION], [__KCAPI_MINVERSION])
20 AC_DEFINE([KCAPI_PATCHLEVEL], [__KCAPI_PATCHLEVEL])
21 AM_INIT_AUTOMAKE([foreign])
22 LT_INIT([pic-only])
23 AC_SUBST([LIBTOOL_DEPS])
24 AC_PROG_CC
25 AC_CONFIG_FILES([Makefile])
26 AC_CONFIG_MACRO_DIR([m4])
27 AX_PROG_CC_FOR_BUILD
28 AX_CHECK_PIE
29
30 AC_PATH_PROG([OPENSSL], [openssl])
31 AC_PATH_PROG([CLANG], [clang])
32 AC_PATH_PROG([CPPCHECK], [cppcheck])
33 AC_PATH_PROG([XMLTO], [xmlto])
34 AC_PATH_PROG([DB2PDF], [db2pdf])
35 AC_PATH_PROG([DB2PS], [db2ps])
36 AC_PATH_PROG([MKTEMP], [mktemp])
37
38 AC_SEARCH_LIBS(clock_gettime,rt)
39 AC_PROG_MKDIR_P
40 AC_PROG_SED
41 AC_PROG_INSTALL
42 AC_PROG_LN_S
43 AC_PATH_PROG([CP], [cp])
44 AC_PATH_PROG([LN], [ln])
45 AC_PATH_PROG([MV], [mv])
46 AC_PATH_PROG([TOUCH], [touch])
47
48 AM_CONDITIONAL([HAVE_OPENSSL], [test "x$OPENSSL" != "x"])
49 AM_CONDITIONAL([HAVE_CLANG], [test "x$CLANG" != "x"])
50 AM_CONDITIONAL([HAVE_CPPCHECK], [test "x$CPPCHECK" != "x"])
51 AM_CONDITIONAL([HAVE_XMLTO], [test "x$XMLTO" != "x"])
52 AM_CONDITIONAL([HAVE_DB2PDF], [test "x$DB2PDF" != "x"])
53 AM_CONDITIONAL([HAVE_DB2PS], [test "x$DB2PS" != "x"])
54 AM_CONDITIONAL([HAVE_MKTEMP], [test "x$MKTEMP" != "x"])
55
56 AM_COND_IF([HAVE_OPENSSL], [], [AC_MSG_WARN([openssl not installed])])
57 AM_COND_IF([HAVE_CLANG], [], [AC_MSG_WARN([clang not installed])])
58 AM_COND_IF([HAVE_CPPCHECK], [], [AC_MSG_WARN([cppcheck not installed])])
59 AM_COND_IF([HAVE_XMLTO], [], [AC_MSG_WARN([xmlto not installed])])
60 AM_COND_IF([HAVE_DB2PDF], [], [AC_MSG_WARN([db2pdf not installed])])
61 AM_COND_IF([HAVE_DB2PS], [], [AC_MSG_WARN([db2ps not installed])])
62 AM_COND_IF([HAVE_MKTEMP], [], [AC_MSG_WARN([mktemp not installed])])
63
64 AC_CHECK_FUNCS(getrandom)
65 AC_CHECK_FUNCS(secure_getenv)
66
67 my_cflags="$CFLAGS"
68 CFLAGS="-Werror -fstack-protector-strong"
69 AC_MSG_CHECKING([whether CC supports -fstack-protector-strong])
70 AC_LINK_IFELSE([AC_LANG_PROGRAM([])],
71 [AC_MSG_RESULT([yes])]
72 CFLAGS="-fstack-protector-strong $my_cflags",
73 [AC_MSG_RESULT([no])]
74 CFLAGS="$my_cflags")
75 AX_ADD_FORTIFY_SOURCE
76
77 AC_CHECK_API_VERSION
78
79 AC_ARG_ENABLE([kcapi-test], [AS_HELP_STRING([--enable-kcapi-test], [Compile kcapi test program])], [with_kcapi_test=$enableval])
80 AM_CONDITIONAL([ENABLE_KCAPI_TEST], [test "x$with_kcapi_test" = "xyes"])
81
82 AC_ARG_ENABLE([kcapi-speed], [AS_HELP_STRING([--enable-kcapi-speed], [Compile kcapi-speed test program])], [with_kcapi_speed_test=$enableval])
83 AM_CONDITIONAL([ENABLE_KCAPI_SPEED], [test "x$with_kcapi_speed_test" = "xyes"])
84
85 AC_ARG_ENABLE([kcapi-hasher], [AS_HELP_STRING([--enable-kcapi-hasher], [Compile hasher application])], [with_kcapi_hasher=$enableval])
86 AM_CONDITIONAL([ENABLE_KCAPI_HASHER], [test "x$with_kcapi_hasher" = "xyes"])
87
88 AC_ARG_ENABLE([kcapi-rngapp], [AS_HELP_STRING([--enable-kcapi-rngapp], [Compile rng read application])], [with_kcapi_rngapp=$enableval])
89 AM_CONDITIONAL([ENABLE_KCAPI_RNGAPP], [test "x$with_kcapi_rngapp" = "xyes"])
90
91 AC_ARG_ENABLE([kcapi-encapp], [AS_HELP_STRING([--enable-kcapi-encapp], [Compile enc application])], [with_kcapi_encapp=$enableval])
92 AM_CONDITIONAL([ENABLE_KCAPI_ENCAPP], [test "x$with_kcapi_encapp" = "xyes"])
93
94 AC_ARG_ENABLE([kcapi-dgstapp], [AS_HELP_STRING([--enable-kcapi-dgstapp], [Compile dgst application])], [with_kcapi_dgstapp=$enableval])
95 AM_CONDITIONAL([ENABLE_KCAPI_DGSTAPP], [test "x$with_kcapi_dgstapp" = "xyes"])
96
97 AC_ARG_ENABLE([lib-kdf], [AS_HELP_STRING([--disable-lib-kdf], [Disable KDF support in library to make it smaller])], [with_lib_kdf=$enableval])
98 AM_CONDITIONAL([DISABLE_LIB_KDF], [test "x$with_lib_kdf" = "xno"])
99
100 AC_ARG_ENABLE([lib-sym], [AS_HELP_STRING([--disable-lib-sym], [Disable symmetric cipher support in library to make it smaller])], [with_lib_sym=$enableval])
101 AM_CONDITIONAL([DISABLE_LIB_SYM], [test "x$with_lib_sym" = "xno"])
102
103 AC_ARG_ENABLE([lib-md], [AS_HELP_STRING([--disable-lib-md], [Disable message digest support in library to make it smaller])], [with_lib_md=$enableval])
104 AM_CONDITIONAL([DISABLE_LIB_MD], [test "x$with_lib_md" = "xno"])
105
106 AC_ARG_ENABLE([lib-aead], [AS_HELP_STRING([--disable-lib-aead], [Disable AEAD cipher support in library to make it smaller])], [with_lib_aead=$enableval])
107 AM_CONDITIONAL([DISABLE_LIB_AEAD], [test "x$with_lib_aead" = "xno"])
108
109 AC_ARG_ENABLE([lib-rng], [AS_HELP_STRING([--disable-lib-rng], [Disable random number generator support in library to make it smaller])], [with_lib_rng=$enableval])
110 AM_CONDITIONAL([DISABLE_LIB_RNG], [test "x$with_lib_rng" = "xno"])
111
112 AC_ARG_ENABLE([lib-asym], [AS_HELP_STRING([--enable-lib-asym], [Enable asymmetric cipher support in library])], [with_lib_asym=$enableval])
113 AM_CONDITIONAL([ENABLE_LIB_ASYM], [test "x$with_lib_asym" = "xyes"])
114 if test "$with_lib_asym" = "yes"; then
115 AC_DEFINE([WITH_LIB_ASYM], 1, [Asymmetric support enabled])
116 fi
117
118 AC_ARG_ENABLE([lib-kpp], [AS_HELP_STRING([--enable-lib-kpp], [Enable key protocol primitives support in library])], [with_lib_kpp=$enableval])
119 AM_CONDITIONAL([ENABLE_LIB_KPP], [test "x$with_lib_kpp" = "xyes"])
120 if test "$with_lib_kpp" = "yes"; then
121 AC_DEFINE([WITH_LIB_KPP], 1, [KPP support enabled])
122 fi
123
124 AC_ARG_ENABLE([sum-prefix],
125 AS_HELP_STRING([--enable-sum-prefix=PRE],[prefix to add to filenames when deriving the binary's checksum file's name (default ".")]),
126 if test x$enableval != xno ; then
127 CHECK_PREFIX="$enableval"
128 else
129 CHECK_PREFIX=
130 fi
131 ,CHECK_PREFIX=.)
132
133 AC_ARG_ENABLE([sum-suffix],
134 AS_HELP_STRING([--enable-sum-suffix=EXT],[suffix to add to filenames when deriving the binary's checksum file's name (default "hmac")]),
135 if test x$enableval != xno ; then
136 CHECK_SUFFIX="$enableval"
137 else
138 CHECK_SUFFIX=
139 fi
140 ,CHECK_SUFFIX=hmac)
141
142 AC_ARG_ENABLE([sum-dir],
143 AS_HELP_STRING([--enable-sum-dir=DIR],[directory where HMAC checksum files will be placed (default: place alongside binaries)]),
144 if test x$enableval != xno ; then
145 CHECK_DIR="$enableval"
146 else
147 CHECK_DIR=
148 fi
149 ,CHECK_DIR=)
150
151 AC_SUBST(CHECK_PREFIX)
152 AC_SUBST(CHECK_SUFFIX)
153 AC_SUBST(CHECK_DIR)
154
155 AC_DEFINE_UNQUOTED(CHECK_PREFIX,"$CHECK_PREFIX",[Define to the prefix which contains the hmac for a binary.])
156 AC_DEFINE_UNQUOTED(CHECK_SUFFIX,"$CHECK_SUFFIX",[Define to the suffix which contains the hmac for a binary.])
157 AS_IF([test "x$CHECK_DIR" != "x"], [
158 AC_DEFINE_UNQUOTED(CHECK_DIR,"$CHECK_DIR",[Define to the directory which contains the hmac for a binary.])
159 ])
160
161 AC_SYS_LARGEFILE
162 AC_TYPE_OFF_T
163 AC_FUNC_FSEEKO
164
165 PKG_INSTALLDIR
166 if test "x$pkgconfigdir" = "x"; then
167 pkgconfigdir="${libdir}/pkgconfig"
168 fi
169 AC_SUBST([pkgconfigdir], [$pkgconfigdir])
170
171 AC_CONFIG_FILES([libkcapi.pc])
172
173 AC_OUTPUT