ykpers_include_HEADERS += ykpbkdf2.h
lib_LTLIBRARIES = libykpers-1.la
-libykpers_1_la_SOURCES = ykpers.c ykpers-version.c ykpbkdf2.c ykpers-json.c
+libykpers_1_la_SOURCES = ykpers.c ykpers-version.c ykpbkdf2.c
+if JSON
+libykpers_1_la_SOURCES += ykpers-json.c
+else
+libykpers_1_la_SOURCES += ykpers-nojson.c
+endif
libykpers_1_la_SOURCES += ykpers_lcl.h ykpers-json.h ykpers_lcl.c
libykpers_1_la_SOURCES += rfc4634/hmac.c rfc4634/usha.c rfc4634/sha.h \
rfc4634/sha1.c rfc4634/sha224-256.c rfc4634/sha384-512.c \
AM_CONDITIONAL([BACKEND_OSX], test x$with_backend = xosx)
AM_CONDITIONAL([BACKEND_WINDOWS], test x$with_backend = xwindows)
-PKG_CHECK_MODULES([libjson], [json-c], [], [
- PKG_CHECK_MODULES([libjson], [json])])
+AC_ARG_WITH([json],
+ AC_HELP_STRING([--without-json], [without JSON YCFG support]),
+ [with_json=$withval], [with_json=yes])
+if test x$with_json = xyes; then
+ PKG_CHECK_MODULES([libjson], [json-c], [], [
+ PKG_CHECK_MODULES([libjson], [json], [], [with_json=no])])
+fi
+AC_MSG_CHECKING([whether to use json library])
+AC_MSG_RESULT([$with_json])
+AM_CONDITIONAL([JSON], [test "$with_json" = yes])
# Check for json_object_to_json_string_ext, needed for pretty printing.
am_save_CFLAGS="$CFLAGS"