add --enable-wallet-only flag to build libtalerutil_wallet which ONLY contains the wallet-specific API subset

This commit is contained in:
Christian Grothoff 2015-05-28 11:34:06 +02:00
parent c742db86c4
commit de953fa7bc
4 changed files with 99 additions and 16 deletions

View File

@ -38,6 +38,21 @@ CFLAGS="-Wall $CFLAGS"
# Checks for header files. # Checks for header files.
AC_CHECK_HEADERS([stdint.h stdlib.h string.h unistd.h]) AC_CHECK_HEADERS([stdint.h stdlib.h string.h unistd.h])
# should the build process be restricted to the code required
# for GNU Taler wallets?
AC_MSG_CHECKING(whether to compile GNU Taler Wallet library ONLY)
AC_ARG_ENABLE([wallet],
[AS_HELP_STRING([--wallet], [only compile for Taler wallet])],
[wallet_only=${enableval}],
[wallet_only=no])
AC_MSG_RESULT($wallet_only)
AM_CONDITIONAL([WALLET_ONLY], [test "x$wallet_only" = "xyes"])
if test "$wallet_only" != yes
then
# Check for GNUnet's libgnunetutil. # Check for GNUnet's libgnunetutil.
libgnunetutil=0 libgnunetutil=0
AC_MSG_CHECKING([for libgnunetutil]) AC_MSG_CHECKING([for libgnunetutil])
@ -64,14 +79,6 @@ AS_IF([test $libgnunetutil != 1],
*** https://gnunet.org *** https://gnunet.org
*** ]])]) *** ]])])
TALER_LIB_LDFLAGS="-export-dynamic -no-undefined"
TALER_PLUGIN_LDFLAGS="-export-dynamic -avoid-version -module -no-undefined"
AC_SUBST(TALER_LIB_LDFLAGS)
AC_SUBST(TALER_PLUGIN_LDFLAGS)
# check for libmicrohttpd # check for libmicrohttpd
microhttpd=0 microhttpd=0
AC_MSG_CHECKING([for microhttpd]) AC_MSG_CHECKING([for microhttpd])
@ -94,13 +101,6 @@ AS_IF([test $microhttpd = 0],
*** ]])]) *** ]])])
# test for postgres
AX_LIB_POSTGRESQL([9.3])
if test "$found_postgresql" = "yes"; then
postgres=true
fi
AM_CONDITIONAL(HAVE_POSTGRESQL, test x$postgres = xtrue)
# check for libjansson (Jansson JSON library) # check for libjansson (Jansson JSON library)
jansson=0 jansson=0
AC_MSG_CHECKING([for jansson]) AC_MSG_CHECKING([for jansson])
@ -122,6 +122,53 @@ AS_IF([test $jansson = 0],
*** You need libjansson to build this program. *** You need libjansson to build this program.
*** ]])]) *** ]])])
else
# Check for GNUnet's libgnunetutil_taler_wallet.
libgnunetutil_taler_wallet=0
AC_MSG_CHECKING([for libgnunetutil_taler_wallet])
AC_ARG_WITH(gnunet,
[AS_HELP_STRING([--with-gnunet=PFX], [base of GNUnet installation])],
[AC_MSG_RESULT([given as $with_gnunet])],
[AC_MSG_RESULT(not given)
with_gnunet=yes])
AS_CASE([$with_gnunet],
[yes], [],
[no], [AC_MSG_ERROR([--with-gnunet is required])],
[LDFLAGS="-L$with_gnunet/lib $LDFLAGS"
CPPFLAGS="-I$with_gnunet/include $CPPFLAGS"])
AC_CHECK_HEADERS([gnunet/platform.h gnunet/gnunet_util_taler_wallet_lib.h],
[AC_CHECK_LIB([gnunetutil_taler_wallet], [GNUNET_CRYPTO_hash], libgnunetutil_taler_wallet=1)],
[], [#ifdef HAVE_GNUNET_PLATFORM_H
#include <gnunet/platform.h>
#endif])
AS_IF([test $libgnunetutil_taler_wallet != 1],
[AC_MSG_ERROR([[
***
*** You need libgnunetutil_taler_wallet to build this program.
*** This library is part of GNUnet, available at
*** https://gnunet.org/
*** Run GNUnet's configure with --enable-taler-wallet as well!
*** ]])])
fi
TALER_LIB_LDFLAGS="-export-dynamic -no-undefined"
TALER_PLUGIN_LDFLAGS="-export-dynamic -avoid-version -module -no-undefined"
AC_SUBST(TALER_LIB_LDFLAGS)
AC_SUBST(TALER_PLUGIN_LDFLAGS)
# test for postgres
AX_LIB_POSTGRESQL([9.3])
if test "$found_postgresql" = "yes"; then
postgres=true
fi
AM_CONDITIONAL(HAVE_POSTGRESQL, test x$postgres = xtrue)
# check for libgnurl # check for libgnurl
# libgnurl # libgnurl
LIBGNURL_CHECK_CONFIG(,7.34.0,gnurl=1,gnurl=0) LIBGNURL_CHECK_CONFIG(,7.34.0,gnurl=1,gnurl=0)

View File

@ -3,7 +3,13 @@ AM_CPPFLAGS = -I$(top_srcdir)/src/include
if HAVE_POSTGRESQL if HAVE_POSTGRESQL
PQ_DIR = pq PQ_DIR = pq
endif endif
if WALLET_ONLY
SUBDIRS = include util
else
SUBDIRS = include util $(PQ_DIR) mintdb mint mint-tools SUBDIRS = include util $(PQ_DIR) mintdb mint mint-tools
if HAVE_LIBCURL if HAVE_LIBCURL
SUBDIRS += mint-lib SUBDIRS += mint-lib
endif endif
endif

View File

@ -1,6 +1,15 @@
# This Makefile.am is in the public domain # This Makefile.am is in the public domain
talerincludedir = $(includedir)/taler talerincludedir = $(includedir)/taler
if WALLET_ONLY
talerinclude_HEADERS = \
platform.h \
taler_amount_lib.h \
taler_crypto_lib.h \
taler_util_wallet.h
else
talerinclude_HEADERS = \ talerinclude_HEADERS = \
platform.h \ platform.h \
taler_amount_lib.h \ taler_amount_lib.h \
@ -12,3 +21,5 @@ talerinclude_HEADERS = \
taler_mintdb_plugin.h \ taler_mintdb_plugin.h \
taler_pq_lib.h \ taler_pq_lib.h \
taler_signatures.h taler_signatures.h
endif

View File

@ -6,8 +6,27 @@ if USE_COVERAGE
XLIB = -lgcov XLIB = -lgcov
endif endif
if WALLET_ONLY
lib_LTLIBRARIES = \
libtalerutil_wallet.la
else
lib_LTLIBRARIES = \ lib_LTLIBRARIES = \
libtalerutil.la libtalerutil.la
endif
libtalerutil_wallet_la_SOURCES = \
amount.c \
crypto.c \
util.c
libtalerutil_wallet_la_LIBADD = \
-lgnunetutil_taler_wallet \
$(LIBGCRYPT_LIBS) \
$(XLIB)
libtalerutil_wallet_la_LDFLAGS = \
-version-info 0:0:0 \
-export-dynamic -no-undefined
libtalerutil_la_SOURCES = \ libtalerutil_la_SOURCES = \
amount.c \ amount.c \