commit 20fa0cd7f044d3d074e5cb1208409b9dadccb7aa
parent a57f3f0a13d53d8196c3b86fba0bb17d89153c2f
Author: Florian Dold <florian.dold@gmail.com>
Date: Sat, 26 Aug 2017 00:09:47 +0200
check for specific jansson version using pkgconfig
We'll need a feature only available in jansson>=2.3, and it's easier to
check it using pkgconfig.
Diffstat:
1 file changed, 5 insertions(+), 18 deletions(-)
diff --git a/configure.ac b/configure.ac
@@ -152,27 +152,14 @@ AS_IF([test $microhttpd = 0],
*** You need libmicrohttpd to build this program.
*** ]])])
-
-# check for libjansson (Jansson JSON library)
jansson=0
-AC_MSG_CHECKING([for jansson])
-AC_ARG_WITH([jansson],
- [AS_HELP_STRING([--with-jansson=PFX], [base of jansson installation])],
- [AC_MSG_RESULT([given as $with_jansson])],
- [AC_MSG_RESULT([not given])
- with_jansson=yes])
-AS_CASE([$with_jansson],
- [yes], [],
- [no], [AC_MSG_ERROR([--with-jansson is required])],
- [LDFLAGS="-L$with_jansson/lib $LDFLAGS"
- CPPFLAGS="-I$with_jansson/include $CPPFLAGS"])
-AC_CHECK_LIB(jansson,json_pack,
- [AC_CHECK_HEADER([jansson.h],[jansson=1])])
-AS_IF([test $jansson = 0],
- [AC_MSG_ERROR([[
+PKG_CHECK_MODULES([JANSSON], [jansson >= 2.3],
+ [LDFLAGS="$JANSSON_LIBS $LDFLAGS"
+ CPPFLAGS="$JANSSON_CFLAGS $CPPFLAGS"],
+ [AC_MSG_ERROR([[
***
*** You need libjansson to build this program.
-*** ]])])
+***]])])
# check for libgnurl
# libgnurl