Skip to content

Commit 58c5cc9

Browse files
committed
Adjust configure so that only bip70 is disabled when protobuf is missing instead of the GUI
1 parent edc7152 commit 58c5cc9

File tree

1 file changed

+20
-10
lines changed

1 file changed

+20
-10
lines changed

configure.ac

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ AC_ARG_ENABLE([bip70],
213213
[AS_HELP_STRING([--disable-bip70],
214214
[disable BIP70 (payment protocol) support in GUI (enabled by default)])],
215215
[enable_bip70=$enableval],
216-
[enable_bip70=yes])
216+
[enable_bip70=auto])
217217

218218
AC_ARG_WITH([protoc-bindir],[AS_HELP_STRING([--with-protoc-bindir=BIN_DIR],[specify protoc bin path])], [protoc_bin_path=$withval], [])
219219

@@ -1088,7 +1088,7 @@ if test x$use_pkgconfig = xyes; then
10881088
PKG_CHECK_MODULES([SSL], [libssl],, [AC_MSG_ERROR(openssl not found.)])
10891089
PKG_CHECK_MODULES([CRYPTO], [libcrypto],,[AC_MSG_ERROR(libcrypto not found.)])
10901090
if test x$enable_bip70 != xno; then
1091-
BITCOIN_QT_CHECK([PKG_CHECK_MODULES([PROTOBUF], [protobuf], [have_protobuf=yes], [BITCOIN_QT_FAIL(libprotobuf not found)])])
1091+
BITCOIN_QT_CHECK([PKG_CHECK_MODULES([PROTOBUF], [protobuf], [have_protobuf=yes], [have_protobuf=no])])
10921092
fi
10931093
if test x$use_qr != xno; then
10941094
BITCOIN_QT_CHECK([PKG_CHECK_MODULES([QR], [libqrencode], [have_qrencode=yes], [have_qrencode=no])])
@@ -1150,7 +1150,7 @@ else
11501150
fi
11511151

11521152
if test x$enable_bip70 != xno; then
1153-
BITCOIN_QT_CHECK(AC_CHECK_LIB([protobuf] ,[main],[PROTOBUF_LIBS=-lprotobuf], BITCOIN_QT_FAIL(libprotobuf not found)))
1153+
BITCOIN_QT_CHECK(AC_CHECK_LIB([protobuf] ,[main],[PROTOBUF_LIBS=-lprotobuf], [have_protobuf=no]))
11541154
fi
11551155
if test x$use_qr != xno; then
11561156
BITCOIN_QT_CHECK([AC_CHECK_LIB([qrencode], [main],[QR_LIBS=-lqrencode], [have_qrencode=no])])
@@ -1229,8 +1229,10 @@ AM_CONDITIONAL([EMBEDDED_UNIVALUE],[test x$need_bundled_univalue = xyes])
12291229
AC_SUBST(UNIVALUE_CFLAGS)
12301230
AC_SUBST(UNIVALUE_LIBS)
12311231

1232-
if test x$enable_bip70 != xno; then
1233-
BITCOIN_QT_PATH_PROGS([PROTOC], [protoc],$protoc_bin_path)
1232+
1233+
if test x$have_protobuf != xno &&
1234+
test x$enable_bip70 != xno; then
1235+
BITCOIN_QT_PATH_PROGS([PROTOC], [protoc],$protoc_bin_path)
12341236
fi
12351237

12361238
AC_MSG_CHECKING([whether to build bitcoind])
@@ -1351,12 +1353,20 @@ if test x$bitcoin_enable_qt != xno; then
13511353
fi
13521354

13531355
AC_MSG_CHECKING([whether to build BIP70 support])
1354-
if test x$enable_bip70 != xno; then
1355-
AC_DEFINE([ENABLE_BIP70],[1],[Define if BIP70 support should be compiled in])
1356-
enable_bip70=yes
1357-
AC_MSG_RESULT([yes])
1356+
if test x$have_protobuf = xno; then
1357+
if test x$enable_bip70 = xyes; then
1358+
AC_MSG_ERROR(protobuf missing)
1359+
fi
1360+
enable_bip70=no
1361+
AC_MSG_RESULT(no)
13581362
else
1359-
AC_MSG_RESULT([no])
1363+
if test x$enable_bip70 != xno; then
1364+
AC_DEFINE([ENABLE_BIP70],[1],[Define if BIP70 support should be compiled in])
1365+
enable_bip70=yes
1366+
AC_MSG_RESULT([yes])
1367+
else
1368+
AC_MSG_RESULT([no])
1369+
fi
13601370
fi
13611371
fi
13621372

0 commit comments

Comments
 (0)