blob: 20c7b7e0ab6eac23df883fea2b8a193a29e73664 [file] [log] [blame]
NingSun0c89b3c2018-02-08 08:34:03 -08001AC_DEFUN([ACX_P11KIT],[
2 AC_ARG_ENABLE([p11-kit],
3 AC_HELP_STRING([--enable-p11-kit],
4 [Enable p11-kit integration (default enabled)]
5 ),
6 [enable_p11kit="${enableval}"],
7 [enable_p11kit="yes"]
8 )
9
10 AC_ARG_WITH(p11-kit,
11 AC_HELP_STRING([--with-p11-kit=PATH],[Specify install path of the p11-kit module, will override path given by pkg-config]),
12 [P11KIT_PATH="$withval"],
13 [P11KIT_PATH=""]
14 )
15
16 AC_MSG_CHECKING(for p11-kit integration)
17 if test "x${enable_p11kit}" = "xyes"; then
18 AC_MSG_RESULT(yes)
19 if test "x${P11KIT_PATH}" = "x"; then
20 AC_PATH_PROG(PKGCONFIG, [pkg-config])
21 if test "x${PKGCONFIG}" != "x" && ${PKGCONFIG} --exists p11-kit-1; then
22 P11KIT_PATH=`${PKGCONFIG} --variable=p11_module_configs p11-kit-1`
23 fi
24 fi
25 AC_MSG_CHECKING(where to install the p11-kit module)
26 AC_MSG_RESULT($P11KIT_PATH)
27 if test "x${P11KIT_PATH}" = "x"; then
28 AC_MSG_WARN([Missing install path for the p11-kit module, skipping module])
29 fi
30 else
31 AC_MSG_RESULT(no)
32 fi
33
34 AC_SUBST(P11KIT_PATH)
35 AM_CONDITIONAL([WITH_P11KIT], [test "x${enable_p11kit}" = "xyes" -a "x${P11KIT_PATH}" != "x"])
36])