diff options
| author | Christophe Fergeau <cfergeau@redhat.com> | 2014-12-08 18:26:14 +0100 |
|---|---|---|
| committer | Christophe Fergeau <cfergeau@redhat.com> | 2014-12-09 16:38:03 +0100 |
| commit | fb3fe2272cf6fa27642593f79b351802787319d4 (patch) | |
| tree | 15c8158db779cc850a3322394b16497f5c5c10d7 /m4 | |
| parent | df74a17238e376b00cbafe7a48e8e4b406095755 (diff) | |
| download | spice-common-fb3fe2272cf6fa27642593f79b351802787319d4.tar.gz spice-common-fb3fe2272cf6fa27642593f79b351802787319d4.tar.xz spice-common-fb3fe2272cf6fa27642593f79b351802787319d4.zip | |
build-sys: Move smartcard check to m4 macro
Diffstat (limited to 'm4')
| -rw-r--r-- | m4/spice-deps.m4 | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/m4/spice-deps.m4 b/m4/spice-deps.m4 index 3dcc4b0..f5bf05f 100644 --- a/m4/spice-deps.m4 +++ b/m4/spice-deps.m4 @@ -25,3 +25,32 @@ AC_DEFUN([SPICE_CHECK_SYSDEPS], [ AC_FUNC_FORK AC_CHECK_FUNCS([dup2 floor inet_ntoa memmove memset pow sqrt]) ]) + + +# SPICE_CHECK_SMARTCARD(PREFIX) +# ----------------------------- +# Adds a --enable-smartcard switch in order to enable/disable smartcard +# support, and checks if the needed libraries are available. If found, it will +# append the flags to use to the $PREFIX_CFLAGS and $PREFIX_LIBS variables, and +# it will define a USE_SMARTCARD preprocessor symbol. +#------------------------------ +AC_DEFUN([SPICE_CHECK_SMARTCARD], [ + AC_ARG_ENABLE([smartcard], + AS_HELP_STRING([--enable-smartcard=@<:@yes/no/auto@:>@], + [Enable smartcard support @<:@default=auto@:>@]), + [], + [enable_smartcard="auto"]) + + have_smartcard=no + if test "x$enable_smartcard" != "xno"; then + PKG_CHECK_MODULES([SMARTCARD], [libcacard >= 0.1.2], [have_smartcard=yes], [have_smartcard=no]) + if test "x$enable_smartcard" != "xauto" && test "x$have_smartcard" = "xno"; then + AC_MSG_ERROR("Smartcard support requested but libcacard could not be found") + fi + if test "x$have_smartcard" = "xyes"; then + AC_DEFINE(USE_SMARTCARD, [1], [Define if supporting smartcard proxying]) + fi + fi + AS_VAR_APPEND([$1_CFLAGS], [" $SMARTCARD_CFLAGS"]) + AS_VAR_APPEND([$1_LIBS], [" $SMARTCARD_LIBS"]) +]) |
