forked from Mellanox/pka
-
Notifications
You must be signed in to change notification settings - Fork 1
/
configure.ac
94 lines (81 loc) · 2.82 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
AC_PREREQ([2.69])
m4_define([libpka_VERSION], [2.0])
AC_INIT([libpka], m4_defn([libpka_VERSION]), [[email protected]], [libpka-]m4_defn([libpka_VERSION]), [https://github.com/Mellanox/pka])
AC_CONFIG_SRCDIR([engine/e_bluefield.c])
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_HEADERS([config.h])
AM_INIT_AUTOMAKE([foreign no-define subdir-objects])
AC_CANONICAL_HOST
AC_MSG_CHECKING([host architecture])
AS_IF(
[test x"$host_cpu" = x"aarch64"],
[AC_MSG_RESULT([ok])],
[AC_MSG_ERROR([only aarch64 is supported])]
)
AC_PROG_CC
AC_PROG_INSTALL
AM_PROG_AS
PKG_PROG_PKG_CONFIG
AC_CHECK_HEADERS([fcntl.h inttypes.h stdint.h sys/ioctl.h sys/time.h unistd.h])
AC_CHECK_HEADER_STDBOOL
AC_C_INLINE
AC_TYPE_INT32_T
AC_TYPE_INT64_T
AC_TYPE_INT8_T
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_TYPE_SSIZE_T
AC_TYPE_UINT16_T
AC_TYPE_UINT32_T
AC_TYPE_UINT64_T
AC_TYPE_UINT8_T
AC_FUNC_MALLOC
AC_FUNC_MMAP
AC_CHECK_FUNCS([gettimeofday memset munmap strcasecmp strrchr strtol])
AX_PTHREAD
LT_INIT([shared disable-static pic-only])
ENABLED_SUBDIRS=lib
dnl Checks for tests utils
AC_ARG_ENABLE([testutils],
[AS_HELP_STRING([--disable-testutils], [Disable building PKA tests utilities (Default: yes)])],
[],
[enable_testutils=yes])
AS_IF([test x"$enable_testutils" != x"no"],
[ENABLED_SUBDIRS="$ENABLED_SUBDIRS tests"]
)
dnl Checks if need to enable openssl pka engine
AC_ARG_WITH([libcrypto],
[AS_HELP_STRING([--with-libcrypto], [Build PKA openssl engine if libcrypto is present and have version no less than 1.1. This requires pkg-config program and pc file for libcrypto (Default: libcrypto)])],
[],
[with_libcrypto=libcrypto])
AS_IF([test x"$with_libcrypto" != x"no"],
[PKG_CHECK_MODULES([LIBCRYPTO],
["$with_libcrypto" >= 1.1.0],[],
[AC_MSG_ERROR([libcrypto library is either not found or its version less than 1.1 (to disable use --without-libcrypto)])]
)
ENABLED_SUBDIRS="$ENABLED_SUBDIRS engine"
cryptoenginesdir=$($PKG_CONFIG --variable=enginesdir --silence-errors $with_libcrypto)
AC_SUBST([cryptoenginesdir])
AC_SUBST([LIBCRYPTO_CFLAGS])
AC_SUBST([LIBCRYPTO_LIBS])
]
)
dnl Documentation
AC_ARG_WITH([doxygen],
[AS_HELP_STRING([--with-doxygen], [Generate documentation. This requires doxygen program (Default: doxygen)])],
[],
[with_doxygen=doxygen])
AS_IF([test x"$with_doxygen" != x"no"],
[AC_PATH_TOOL([DOXYGEN],["$with_doxygen"])
AS_IF([test x"$DOXYGEN" = x""],
[AC_MSG_ERROR([documentation requested but doxygen is not found (to disable use --without-doxygen)])]
)
ENABLED_SUBDIRS="$ENABLED_SUBDIRS doc"
AC_SUBST([DOXYGEN])
]
)
AC_SUBST([AM_CPPFLAGS],["-I\$(top_srcdir)/lib -I\$(top_srcdir)/include"])
AC_SUBST([ENABLED_SUBDIRS])
AC_CONFIG_FILES([Makefile lib/Makefile engine/Makefile tests/Makefile doc/Makefile])
AC_OUTPUT