]> err.no Git - yubikey-personalization/commitdiff
Make libjson optional.
authorSimon Josefsson <simon@josefsson.org>
Fri, 19 Apr 2013 13:09:11 +0000 (15:09 +0200)
committerSimon Josefsson <simon@josefsson.org>
Fri, 19 Apr 2013 13:09:11 +0000 (15:09 +0200)
.gitignore
Makefile.am
configure.ac

index 0e67d966c09485991035f64139630e38395b5764..c73b9c3b33f37ce39046ec9125151c0e0695a98a 100644 (file)
@@ -82,13 +82,15 @@ ykpers-*.tar.gz
 ykpers-*.tar.gz.sig
 ykpers-1.pc
 ykpers-args.o
+ykpers-json.lo
+ykpers-json.o
+ykpers-nojson.lo
+ykpers-nojson.o
 ykpers-version.h
 ykpers-version.lo
 ykpers-version.o
 ykpers.lo
 ykpers.o
-ykpers-json.lo
-ykpers-json.o
 ykpers_lcl.lo
 ykpers_lcl.o
 ykpersonalize
index 0178fbb8193e3bb91ba2b062d9021cb61bd7fd8f..7215717c16ce2dc4d5d71bd0a5a189ad5ed7c71e 100644 (file)
@@ -45,7 +45,12 @@ ykpers_include_HEADERS += ykcore/ykstatus.h ykcore/ykcore.h ykcore/ykdef.h
 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        \
index 093f4b0fb501173c9ddeda780efbc0ce8cb45919..ec10bfac73e0b67bc7974055690b137b992ebad4 100644 (file)
@@ -125,8 +125,16 @@ AM_CONDITIONAL([BACKEND_LIBUSB_1_0], test x$with_backend = xlibusb-1.0)
 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"