Skip to content
This repository has been archived by the owner on May 27, 2020. It is now read-only.

Commit

Permalink
Merge pull request #671 from hashrabbit/feature/with-system-jansson
Browse files Browse the repository at this point in the history
Allow building with system jansson
  • Loading branch information
ckolivas committed Jun 11, 2015
2 parents 1e617ae + 292e174 commit 1e36d6e
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 3 deletions.
2 changes: 2 additions & 0 deletions README
Expand Up @@ -149,6 +149,8 @@ CGMiner specific configuration options:
--without-curses Compile support for curses TUI (default enabled)
--with-system-libusb Compile against dynamic system libusb (default use
included static libusb)
--with-system-jansson Compile against dynamic system jansson (default use
included static jansson)

Basic *nix build instructions:
To actually build:
Expand Down
5 changes: 4 additions & 1 deletion compat/Makefile.am
@@ -1,5 +1,8 @@
SUBDIRS =

SUBDIRS = jansson-2.6
if WANT_STATIC_JANSSON
SUBDIRS += jansson-2.6
endif

if WANT_USBUTILS
if WANT_STATIC_LIBUSB
Expand Down
29 changes: 27 additions & 2 deletions configure.ac
Expand Up @@ -542,8 +542,29 @@ fi

AM_CONDITIONAL([WANT_STATIC_LIBUSB], [test x$dlibusb = xno])

AC_CONFIG_SUBDIRS([compat/jansson-2.6])
JANSSON_LIBS="compat/jansson-2.6/src/.libs/libjansson.a"
djansson="no"
AC_ARG_WITH([system-jansson],
[AC_HELP_STRING([--with-system-jansson],[NOT RECOMMENDED! Compile against dynamic system jansson. (Default use included static jansson)])],
[djansson=$withval]
)

if test "x$djansson" != xno; then
case $target in
*-*-freebsd*)
JANSSON_LIBS="-ljansson"
JANSSON_CFLAGS=""
AC_DEFINE(HAVE_JANSSON, 1, [Define if you have jansson >= 2.6])
;;
*)
PKG_CHECK_MODULES(JANSSON, jansson >= 2.6, [AC_DEFINE(HAVE_JANSSON, 1, [Define if you have jansson >= 2.6])], [AC_MSG_ERROR([Could not find jansson library - please install jansson >= 2.6])])
;;
esac
else
AC_CONFIG_SUBDIRS([compat/jansson-2.6])
JANSSON_LIBS="compat/jansson-2.6/src/.libs/libjansson.a"
fi

AM_CONDITIONAL([WANT_STATIC_JANSSON], [test x$djansson = xno])

PKG_PROG_PKG_CONFIG()

Expand Down Expand Up @@ -836,3 +857,7 @@ if test "x$want_usbutils$dlibusb" = xyesyes; then
echo "*** SYSTEM LIBUSB BEING ADDED - NOT RECOMMENDED UNLESS YOU ARE UNABLE TO COMPILE THE INCLUDED LIBUSB ***"
echo
fi
if test "x$djansson" = xyes; then
echo "*** SYSTEM JANSSON BEING ADDED - NOT RECOMMENDED UNLESS YOU ARE UNABLE TO COMPILE THE INCLUDED JANSSON ***"
echo
fi

0 comments on commit 1e36d6e

Please sign in to comment.