Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 574672
Collapse All | Expand All

(-)/root/bitcoinxt-0.11E/build-aux/m4/bitcoin_subdir_to_include.m4 (-1 / +1 lines)
Lines 5-11 Link Here
5
    AC_MSG_RESULT([default])
5
    AC_MSG_RESULT([default])
6
  else
6
  else
7
    echo "#include <$2$3.h>" >conftest.cpp
7
    echo "#include <$2$3.h>" >conftest.cpp
8
    newinclpath=`${CXXCPP} ${CPPFLAGS} -M conftest.cpp 2>/dev/null | [ tr -d '\\n\\r\\\\' | sed -e 's/^.*[[:space:]:]\(\/[^[:space:]]*\)]$3[\.h[[:space:]].*$/\1/' -e t -e d`]
8
    newinclpath=$(${CXXCPP} ${CPPFLAGS} -M conftest.cpp 2>/dev/null | sed [-E -e ':a' -e '/\\$/!b b' -e N -e 's/\\\n/ /' -e 't a' -e ':b' -e 's/^[^:]*:[[:space:]]*(([^[:space:]\]|\\.)*[[:space:]])*(([^[:space:]\]|\\.)*)]$3\.h[([[:space:]].*)?$/\3/' -e 't' -e d])
9
    AC_MSG_RESULT([${newinclpath}])
9
    AC_MSG_RESULT([${newinclpath}])
10
    if test "x${newinclpath}" != "x"; then
10
    if test "x${newinclpath}" != "x"; then
11
      eval "$1=\"\$$1\"' -I${newinclpath}'"
11
      eval "$1=\"\$$1\"' -I${newinclpath}'"
(-)/root/bitcoinxt-0.11E/configure.ac (-6 / +73 lines)
Lines 172-177 Link Here
172
  [build_bitcoin_utils=$withval],
172
  [build_bitcoin_utils=$withval],
173
  [build_bitcoin_utils=yes])
173
  [build_bitcoin_utils=yes])
174
174
175
AC_ARG_ENABLE([util-cli],
176
  [AS_HELP_STRING([--enable-util-cli],
177
  [build bitcoin-cli])],
178
  [build_bitcoin_cli=$enableval],
179
  [build_bitcoin_cli=$build_bitcoin_utils])
180
181
AC_ARG_ENABLE([util-tx],
182
  [AS_HELP_STRING([--enable-util-tx],
183
  [build bitcoin-tx])],
184
  [build_bitcoin_tx=$enableval],
185
  [build_bitcoin_tx=$build_bitcoin_utils])
186
175
AC_ARG_WITH([libs],
187
AC_ARG_WITH([libs],
176
  [AS_HELP_STRING([--with-libs],
188
  [AS_HELP_STRING([--with-libs],
177
  [build libraries (default=yes)])],
189
  [build libraries (default=yes)])],
Lines 494-507 Link Here
494
  [AC_MSG_ERROR([Cannot set default symbol visibility. Use --disable-reduce-exports.])])
506
  [AC_MSG_ERROR([Cannot set default symbol visibility. Use --disable-reduce-exports.])])
495
fi
507
fi
496
508
509
dnl Check for leveldb, only if explicitly requested
497
LEVELDB_CPPFLAGS=
510
LEVELDB_CPPFLAGS=
498
LIBLEVELDB=
511
LIBLEVELDB=
499
LIBMEMENV=
512
LIBMEMENV=
500
AM_CONDITIONAL([EMBEDDED_LEVELDB],[true])
513
AC_ARG_WITH([system-leveldb],
514
  [AS_HELP_STRING([--with-system-leveldb],
515
  [Build with system LevelDB (default is no; DANGEROUS; NOT SUPPORTED)])],
516
  [system_leveldb=$withval],
517
  [system_leveldb=no]
518
)
519
if test x$system_leveldb != xno; then
520
  LEVELDB_CPPFLAGS=
521
  AC_CHECK_LIB([leveldb],[main],[
522
    LIBLEVELDB=-lleveldb
523
  ],[
524
    AC_MSG_ERROR([leveldb library not found; using --with-system-leveldb is not supported anyway])
525
  ])
526
  TEMP_LIBS="$LIBS"
527
  LIBS="$LIBS $LIBLEVELDB"
528
  AC_CHECK_LIB([memenv],[main],[
529
    LIBMEMENV=-lmemenv
530
  ],[
531
    AC_MSG_ERROR([LevelDB's memenv library not found; using --with-system-leveldb is not supported anyway])
532
  ])
533
  LIBS="$TEMP_LIBS"
534
  AC_CHECK_HEADER([leveldb/filter_policy.h],[],[
535
    AC_MSG_ERROR([LevelDB headers not found; using --with-system-leveldb is not supported anyway])
536
  ])
537
  AC_CHECK_HEADER([leveldb/helpers/memenv.h],[
538
    AC_MSG_CHECKING([for memenv.h path])
539
    BITCOIN_SUBDIR_TO_INCLUDE([LEVELDB_CPPFLAGS],[leveldb/helpers/],[memenv])
540
  ],[
541
    AC_CHECK_HEADER([memenv.h],[],[
542
      AC_MSG_ERROR([LevelDB headers not found; using --with-system-leveldb is not supported anyway])
543
    ])
544
  ])
545
fi
546
AM_CONDITIONAL([EMBEDDED_LEVELDB],[test x$system_leveldb = xno])
501
AC_SUBST(LEVELDB_CPPFLAGS)
547
AC_SUBST(LEVELDB_CPPFLAGS)
502
AC_SUBST(LIBLEVELDB)
548
AC_SUBST(LIBLEVELDB)
503
AC_SUBST(LIBMEMENV)
549
AC_SUBST(LIBMEMENV)
504
550
551
dnl Check for libsecp256k1, only if explicitly requested
552
AC_ARG_WITH([system-libsecp256k1],
553
  [AS_HELP_STRING([--with-system-libsecp256k1],
554
  [Build with system libsecp256k1 (default is no; DANGEROUS; NOT SUPPORTED)])],
555
  [system_libsecp256k1=$withval],
556
  [system_libsecp256k1=no]
557
)
558
if test x$system_libsecp256k1 != xno; then
559
  PKG_CHECK_MODULES([libsecp256k1],[libsecp256k1],,[true])
560
else
561
  libsecp256k1_CFLAGS='-I$(srcdir)/secp256k1/include'
562
  libsecp256k1_LIBS='secp256k1/libsecp256k1.la'
563
fi
564
AM_CONDITIONAL([EMBEDDED_LIBSECP256K1],[test x$system_libsecp256k1 = xno])
565
AC_SUBST(libsecp256k1_CFLAGS)
566
AC_SUBST(libsecp256k1_LIBS)
567
505
if test x$enable_wallet != xno; then
568
if test x$enable_wallet != xno; then
506
    dnl Check for libdb_cxx only if wallet enabled
569
    dnl Check for libdb_cxx only if wallet enabled
507
    BITCOIN_FIND_BDB48
570
    BITCOIN_FIND_BDB48
Lines 521-527 Link Here
521
dnl sets $bitcoin_enable_qt, $bitcoin_enable_qt_test, $bitcoin_enable_qt_dbus
584
dnl sets $bitcoin_enable_qt, $bitcoin_enable_qt_test, $bitcoin_enable_qt_dbus
522
BITCOIN_QT_CONFIGURE([$use_pkgconfig], [qt4])
585
BITCOIN_QT_CONFIGURE([$use_pkgconfig], [qt4])
523
586
524
if test x$build_bitcoin_utils$build_bitcoind$bitcoin_enable_qt$use_tests = xnononono; then
587
if test x$build_bitcoin_cli$build_bitcoin_tx$build_bitcoind$bitcoin_enable_qt$use_tests = xnonononono; then
525
    use_boost=no
588
    use_boost=no
526
else
589
else
527
    use_boost=yes
590
    use_boost=yes
Lines 711-719 Link Here
711
AM_CONDITIONAL([BUILD_BITCOIND], [test x$build_bitcoind = xyes])
774
AM_CONDITIONAL([BUILD_BITCOIND], [test x$build_bitcoind = xyes])
712
AC_MSG_RESULT($build_bitcoind)
775
AC_MSG_RESULT($build_bitcoind)
713
776
714
AC_MSG_CHECKING([whether to build utils (bitcoin-cli bitcoin-tx)])
777
AC_MSG_CHECKING([whether to build bitcoin-cli])
715
AM_CONDITIONAL([BUILD_BITCOIN_UTILS], [test x$build_bitcoin_utils = xyes])
778
AM_CONDITIONAL([BUILD_BITCOIN_CLI], [test x$build_bitcoin_cli = xyes])
716
AC_MSG_RESULT($build_bitcoin_utils)
779
AC_MSG_RESULT($build_bitcoin_cli)
780
781
AC_MSG_CHECKING([whether to build bitcoin-tx])
782
AM_CONDITIONAL([BUILD_BITCOIN_TX], [test x$build_bitcoin_tx = xyes])
783
AC_MSG_RESULT($build_bitcoin_tx)
717
784
718
AC_MSG_CHECKING([whether to build libraries])
785
AC_MSG_CHECKING([whether to build libraries])
719
AM_CONDITIONAL([BUILD_BITCOIN_LIBS], [test x$build_bitcoin_libs = xyes])
786
AM_CONDITIONAL([BUILD_BITCOIN_LIBS], [test x$build_bitcoin_libs = xyes])
Lines 836-842 Link Here
836
  AC_MSG_RESULT([no])
903
  AC_MSG_RESULT([no])
837
fi
904
fi
838
905
839
if test x$build_bitcoin_utils$build_bitcoin_libs$build_bitcoind$bitcoin_enable_qt$use_tests = xnonononono; then
906
if test x$build_bitcoin_cli$build_bitcoin_tx$build_bitcoin_libs$build_bitcoind$bitcoin_enable_qt$use_tests = xnononononono; then
840
  AC_MSG_ERROR([No targets! Please specify at least one of: --with-utils --with-libs --with-daemon --with-gui or --enable-tests])
907
  AC_MSG_ERROR([No targets! Please specify at least one of: --with-utils --with-libs --with-daemon --with-gui or --enable-tests])
841
fi
908
fi
842
909
(-)/root/bitcoinxt-0.11E/configure.ac.orig (+926 lines)
Line 0 Link Here
1
dnl require autoconf 2.60 (AS_ECHO/AS_ECHO_N)
2
AC_PREREQ([2.60])
3
4
define(_CLIENT_VERSION_MAJOR, 0)
5
define(_CLIENT_VERSION_MINOR, 11)
6
define(_CLIENT_VERSION_REVISION, 0)
7
define(_CLIENT_VERSION_BUILD, 0)
8
define(_CLIENT_VERSION_IS_RELEASE, true)
9
define(_CLIENT_VERSION_XT_SUBVER, E)
10
11
define(_COPYRIGHT_YEAR, 2015)
12
AC_INIT([Bitcoin XT],[_CLIENT_VERSION_MAJOR._CLIENT_VERSION_MINOR._CLIENT_VERSION_REVISION-_CLIENT_VERSION_XT_SUBVER],[bitcoin-xt@googlegroups.com])
13
AC_CONFIG_SRCDIR([src/main.cpp])
14
AC_CONFIG_HEADERS([src/config/bitcoin-config.h])
15
AC_CONFIG_AUX_DIR([build-aux])
16
AC_CONFIG_MACRO_DIR([build-aux/m4])
17
AC_CANONICAL_HOST
18
19
AH_TOP([#ifndef BITCOIN_CONFIG_H])
20
AH_TOP([#define BITCOIN_CONFIG_H])
21
AH_BOTTOM([#endif //BITCOIN_CONFIG_H])
22
23
dnl faketime breaks configure and is only needed for make. Disable it here.
24
unset FAKETIME
25
26
dnl Automake init set-up and checks
27
AM_INIT_AUTOMAKE([no-define subdir-objects foreign])
28
29
dnl faketime messes with timestamps and causes configure to be re-run.
30
dnl --disable-maintainer-mode can be used to bypass this.
31
AM_MAINTAINER_MODE([enable])
32
33
dnl make the compilation flags quiet unless V=1 is used
34
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
35
36
dnl Compiler checks (here before libtool).
37
if test "x${CXXFLAGS+set}" = "xset"; then
38
  CXXFLAGS_overridden=yes
39
else
40
  CXXFLAGS_overridden=no
41
fi
42
AC_PROG_CXX
43
m4_ifdef([AC_PROG_OBJCXX],[AC_PROG_OBJCXX])
44
45
dnl By default, libtool for mingw refuses to link static libs into a dll for
46
dnl fear of mixing pic/non-pic objects, and import/export complications. Since
47
dnl we have those under control, re-enable that functionality.
48
case $host in
49
  *mingw*)
50
     lt_cv_deplibs_check_method="pass_all"
51
  ;;
52
esac
53
dnl Libtool init checks.
54
LT_INIT([pic-only])
55
56
dnl Check/return PATH for base programs.
57
AC_PATH_TOOL(AR, ar)
58
AC_PATH_TOOL(RANLIB, ranlib)
59
AC_PATH_TOOL(STRIP, strip)
60
AC_PATH_TOOL(GCOV, gcov)
61
AC_PATH_PROG(LCOV, lcov)
62
AC_PATH_PROG(JAVA, java)
63
AC_PATH_PROG(GENHTML, genhtml)
64
AC_PATH_PROG([GIT], [git])
65
AC_PATH_PROG(CCACHE,ccache)
66
AC_PATH_PROG(XGETTEXT,xgettext)
67
AC_PATH_PROG(HEXDUMP,hexdump)
68
69
dnl pkg-config check.
70
PKG_PROG_PKG_CONFIG
71
72
# Enable wallet
73
AC_ARG_ENABLE([wallet],
74
  [AS_HELP_STRING([--enable-wallet],
75
  [enable wallet (default is yes)])],
76
  [enable_wallet=$enableval],
77
  [enable_wallet=yes])
78
79
AC_ARG_WITH([miniupnpc],
80
  [AS_HELP_STRING([--with-miniupnpc],
81
  [enable UPNP (default is yes if libminiupnpc is found)])],
82
  [use_upnp=$withval],
83
  [use_upnp=auto])
84
85
AC_ARG_ENABLE([upnp-default],
86
  [AS_HELP_STRING([--enable-upnp-default],
87
  [if UPNP is enabled, turn it on at startup (default is no)])],
88
  [use_upnp_default=$enableval],
89
  [use_upnp_default=no])
90
91
AC_ARG_ENABLE(tests,
92
    AS_HELP_STRING([--enable-tests],[compile tests (default is yes)]),
93
    [use_tests=$enableval],
94
    [use_tests=yes])
95
96
AC_ARG_WITH([comparison-tool],
97
    AS_HELP_STRING([--with-comparison-tool],[path to java comparison tool (requires --enable-tests)]),
98
    [use_comparison_tool=$withval],
99
    [use_comparison_tool=no])
100
101
AC_ARG_ENABLE([comparison-tool-reorg-tests],
102
    AS_HELP_STRING([--enable-comparison-tool-reorg-tests],[enable expensive reorg tests in the comparison tool (default no)]),
103
    [use_comparison_tool_reorg_tests=$enableval],
104
    [use_comparison_tool_reorg_tests=no])
105
106
AC_ARG_WITH([qrencode],
107
  [AS_HELP_STRING([--with-qrencode],
108
  [enable QR code support (default is yes if qt is enabled and libqrencode is found)])],
109
  [use_qr=$withval],
110
  [use_qr=auto])
111
112
AC_ARG_ENABLE([hardening],
113
  [AS_HELP_STRING([--enable-hardening],
114
  [attempt to harden the resulting executables (default is yes)])],
115
  [use_hardening=$enableval],
116
  [use_hardening=yes])
117
118
AC_ARG_ENABLE([reduce-exports],
119
  [AS_HELP_STRING([--enable-reduce-exports],
120
  [attempt to reduce exported symbols in the resulting executables (default is no)])],
121
  [use_reduce_exports=$enableval],
122
  [use_reduce_exports=no])
123
124
AC_ARG_ENABLE([ccache],
125
  [AS_HELP_STRING([--enable-ccache],
126
  [use ccache for building (default is yes if ccache is found)])],
127
  [use_ccache=$enableval],
128
  [use_ccache=auto])
129
130
AC_ARG_ENABLE([lcov],
131
  [AS_HELP_STRING([--enable-lcov],
132
  [enable lcov testing (default is no)])],
133
  [use_lcov=yes],
134
  [use_lcov=no])
135
136
AC_ARG_ENABLE([glibc-back-compat],
137
  [AS_HELP_STRING([--enable-glibc-back-compat],
138
  [enable backwards compatibility with glibc])],
139
  [use_glibc_compat=$enableval],
140
  [use_glibc_compat=no])
141
142
AC_ARG_WITH([protoc-bindir],[AS_HELP_STRING([--with-protoc-bindir=BIN_DIR],[specify protoc bin path])], [protoc_bin_path=$withval], [])
143
144
# Enable debug 
145
AC_ARG_ENABLE([debug],
146
    [AS_HELP_STRING([--enable-debug],
147
                    [use debug compiler flags and macros (default is no)])],
148
    [enable_debug=$enableval],
149
    [enable_debug=no])
150
151
if test "x$enable_debug" = xyes; then
152
    if test "x$GCC" = xyes; then
153
        CFLAGS="-g3 -O0 -DDEBUG"
154
    fi
155
    
156
    if test "x$GXX" = xyes; then
157
        CXXFLAGS="-g3 -O0 -DDEBUG"
158
    fi
159
fi 
160
161
## TODO: Remove these hard-coded paths and flags. They are here for the sake of
162
##       compatibility with the legacy buildsystem.
163
##
164
if test "x$CXXFLAGS_overridden" = "xno"; then
165
  CXXFLAGS="$CXXFLAGS -Wall -Wextra -Wformat -Wformat-security -Wno-unused-parameter"
166
fi
167
CPPFLAGS="$CPPFLAGS -DBOOST_SPIRIT_THREADSAFE -DHAVE_BUILD_INFO -D__STDC_FORMAT_MACROS"
168
169
AC_ARG_WITH([utils],
170
  [AS_HELP_STRING([--with-utils],
171
  [build bitcoin-cli bitcoin-tx (default=yes)])],
172
  [build_bitcoin_utils=$withval],
173
  [build_bitcoin_utils=yes])
174
175
AC_ARG_WITH([libs],
176
  [AS_HELP_STRING([--with-libs],
177
  [build libraries (default=yes)])],
178
  [build_bitcoin_libs=$withval],
179
  [build_bitcoin_libs=yes])
180
181
AC_ARG_WITH([daemon],
182
  [AS_HELP_STRING([--with-daemon],
183
  [build bitcoind daemon (default=yes)])],
184
  [build_bitcoind=$withval],
185
  [build_bitcoind=yes])
186
187
AC_LANG_PUSH([C++])
188
189
use_pkgconfig=yes
190
case $host in
191
  *mingw*)
192
193
     #pkgconfig does more harm than good with MinGW
194
     use_pkgconfig=no
195
196
     TARGET_OS=windows
197
     AC_CHECK_LIB([mingwthrd],      [main],, AC_MSG_ERROR(lib missing))
198
     AC_CHECK_LIB([kernel32],      [main],, AC_MSG_ERROR(lib missing))
199
     AC_CHECK_LIB([user32],      [main],, AC_MSG_ERROR(lib missing))
200
     AC_CHECK_LIB([gdi32],      [main],, AC_MSG_ERROR(lib missing))
201
     AC_CHECK_LIB([comdlg32],      [main],, AC_MSG_ERROR(lib missing))
202
     AC_CHECK_LIB([winspool],      [main],, AC_MSG_ERROR(lib missing))
203
     AC_CHECK_LIB([winmm],      [main],, AC_MSG_ERROR(lib missing))
204
     AC_CHECK_LIB([shell32],      [main],, AC_MSG_ERROR(lib missing))
205
     AC_CHECK_LIB([comctl32],      [main],, AC_MSG_ERROR(lib missing))
206
     AC_CHECK_LIB([ole32],      [main],, AC_MSG_ERROR(lib missing))
207
     AC_CHECK_LIB([oleaut32],      [main],, AC_MSG_ERROR(lib missing))
208
     AC_CHECK_LIB([uuid],      [main],, AC_MSG_ERROR(lib missing))
209
     AC_CHECK_LIB([rpcrt4],      [main],, AC_MSG_ERROR(lib missing))
210
     AC_CHECK_LIB([advapi32],      [main],, AC_MSG_ERROR(lib missing))
211
     AC_CHECK_LIB([ws2_32],      [main],, AC_MSG_ERROR(lib missing))
212
     AC_CHECK_LIB([mswsock],      [main],, AC_MSG_ERROR(lib missing))
213
     AC_CHECK_LIB([shlwapi],      [main],, AC_MSG_ERROR(lib missing))
214
     AC_CHECK_LIB([iphlpapi],      [main],, AC_MSG_ERROR(lib missing))
215
     AC_CHECK_LIB([crypt32],      [main],, AC_MSG_ERROR(lib missing))
216
217
     # -static is interpreted by libtool, where it has a different meaning.
218
     # In libtool-speak, it's -all-static.
219
     AX_CHECK_LINK_FLAG([[-static]],[LIBTOOL_APP_LDFLAGS="$LIBTOOL_APP_LDFLAGS -all-static"])
220
221
     AC_PATH_PROG([MAKENSIS], [makensis], none)
222
     if test x$MAKENSIS = xnone; then
223
       AC_MSG_WARN("makensis not found. Cannot create installer.")
224
     fi
225
226
     AC_PATH_TOOL(WINDRES, windres, none)
227
     if test x$WINDRES = xnone; then
228
       AC_MSG_ERROR("windres not found")
229
     fi
230
231
     CPPFLAGS="$CPPFLAGS -D_MT -DWIN32 -D_WINDOWS -DBOOST_THREAD_USE_LIB"
232
     LEVELDB_TARGET_FLAGS="TARGET_OS=OS_WINDOWS_CROSSCOMPILE"
233
     if test "x$CXXFLAGS_overridden" = "xno"; then
234
       CXXFLAGS="$CXXFLAGS -w"
235
     fi
236
     case $host in
237
       i?86-*) WINDOWS_BITS=32 ;;
238
       x86_64-*) WINDOWS_BITS=64 ;;
239
       *) AC_MSG_ERROR("Could not determine win32/win64 for installer") ;;
240
     esac
241
     AC_SUBST(WINDOWS_BITS)
242
243
     dnl libtool insists upon adding -nostdlib and a list of objects/libs to link against.
244
     dnl That breaks our ability to build dll's with static libgcc/libstdc++/libssp. Override
245
     dnl its command here, with the predeps/postdeps removed, and -static inserted. Postdeps are
246
     dnl also overridden to prevent their insertion later.
247
     dnl This should only affect dll's.
248
     archive_cmds_CXX="\$CC -shared \$libobjs \$deplibs \$compiler_flags -static -o \$output_objdir/\$soname \${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker \$lib"
249
     postdeps_CXX=
250
251
     ;;
252
  *darwin*)
253
     TARGET_OS=darwin
254
     LEVELDB_TARGET_FLAGS="TARGET_OS=Darwin"
255
     if  test x$cross_compiling != xyes; then
256
       BUILD_OS=darwin
257
       AC_CHECK_PROG([PORT],port, port)
258
       if test x$PORT = xport; then
259
         dnl add default macports paths
260
         CPPFLAGS="$CPPFLAGS -isystem /opt/local/include"
261
         LIBS="$LIBS -L/opt/local/lib"
262
         if test -d /opt/local/include/db48; then
263
           CPPFLAGS="$CPPFLAGS -I/opt/local/include/db48"
264
           LIBS="$LIBS -L/opt/local/lib/db48"
265
         fi
266
       fi
267
268
       AC_CHECK_PROG([BREW],brew, brew)
269
       if test x$BREW = xbrew; then
270
         dnl These Homebrew packages may be keg-only, meaning that they won't be found
271
         dnl in expected paths because they may conflict with system files. Ask
272
         dnl Homebrew where each one is located, then adjust paths accordingly.
273
         dnl It's safe to add these paths even if the functionality is disabled by
274
         dnl the user (--without-wallet or --without-gui for example).
275
276
         openssl_prefix=`$BREW --prefix openssl 2>/dev/null`
277
         bdb_prefix=`$BREW --prefix berkeley-db4 2>/dev/null`
278
         qt5_prefix=`$BREW --prefix qt5 2>/dev/null`
279
         curl_prefix=`$BREW --prefix curl 2>/dev/null`
280
         if test x$openssl_prefix != x; then
281
           PKG_CONFIG_PATH="$openssl_prefix/lib/pkgconfig:$PKG_CONFIG_PATH"
282
           export PKG_CONFIG_PATH
283
         fi
284
         if test x$bdb_prefix != x; then
285
           CPPFLAGS="$CPPFLAGS -I$bdb_prefix/include"
286
           LIBS="$LIBS -L$bdb_prefix/lib"
287
         fi
288
         if test x$qt5_prefix != x; then
289
           PKG_CONFIG_PATH="$qt5_prefix/lib/pkgconfig:$PKG_CONFIG_PATH"
290
           export PKG_CONFIG_PATH
291
         fi
292
         if test x$curl_prefix != x; then
293
           PKG_CONFIG_PATH="$curl_prefix/lib/pkgconfig:$PKG_CONFIG_PATH"
294
         fi
295
       fi
296
     else
297
       case $build_os in
298
         *darwin*)
299
           BUILD_OS=darwin
300
           ;;
301
         *)
302
           AC_PATH_TOOL([INSTALLNAMETOOL], [install_name_tool], install_name_tool)
303
           AC_PATH_TOOL([OTOOL], [otool], otool)
304
           AC_PATH_PROGS([GENISOIMAGE], [genisoimage mkisofs],genisoimage)
305
306
           dnl libtool will try to strip the static lib, which is a problem for
307
           dnl cross-builds because strip attempts to call a hard-coded ld,
308
           dnl which may not exist in the path. Stripping the .a is not
309
           dnl necessary, so just disable it.
310
           old_striplib=
311
           ;;
312
       esac
313
     fi
314
315
     AX_CHECK_LINK_FLAG([[-Wl,-headerpad_max_install_names]], [LDFLAGS="$LDFLAGS -Wl,-headerpad_max_install_names"])
316
     CPPFLAGS="$CPPFLAGS -DMAC_OSX"
317
     ;;
318
   *linux*)
319
     TARGET_OS=linux
320
     ;;
321
   *)
322
     ;;
323
esac
324
325
if test x$use_comparison_tool != xno; then
326
  AC_SUBST(JAVA_COMPARISON_TOOL, $use_comparison_tool)
327
fi
328
329
if test x$use_comparison_tool_reorg_tests != xno; then
330
  if test x$use_comparison_tool = x; then
331
    AC_MSG_ERROR("comparison tool reorg tests but comparison tool was not specified")
332
  fi
333
  AC_SUBST(COMPARISON_TOOL_REORG_TESTS, 1)
334
else
335
  AC_SUBST(COMPARISON_TOOL_REORG_TESTS, 0)
336
fi
337
338
if test x$use_lcov = xyes; then
339
  if test x$LCOV = x; then
340
    AC_MSG_ERROR("lcov testing requested but lcov not found")
341
  fi
342
  if test x$GCOV = x; then
343
    AC_MSG_ERROR("lcov testing requested but gcov not found")
344
  fi
345
  if test x$JAVA = x; then
346
    AC_MSG_ERROR("lcov testing requested but java not found")
347
  fi
348
  if test x$GENHTML = x; then
349
    AC_MSG_ERROR("lcov testing requested but genhtml not found")
350
  fi
351
  if test x$use_comparison_tool = x; then
352
    AC_MSG_ERROR("lcov testing requested but comparison tool was not specified")
353
  fi
354
  LCOV="$LCOV --gcov-tool=$GCOV"
355
  AX_CHECK_COMPILE_FLAG([--coverage],[CXXFLAGS="$CXXFLAGS --coverage"],
356
    [AC_MSG_ERROR("lcov testing requested but --coverage flag does not work")])
357
fi
358
359
dnl Check for endianness
360
AC_C_BIGENDIAN
361
362
dnl Check for pthread compile/link requirements
363
AX_PTHREAD
364
365
# The following macro will add the necessary defines to bitcoin-config.h, but
366
# they also need to be passed down to any subprojects. Pull the results out of
367
# the cache and add them to CPPFLAGS.
368
AC_SYS_LARGEFILE
369
# detect POSIX or GNU variant of strerror_r
370
AC_FUNC_STRERROR_R
371
372
if test x$ac_cv_sys_file_offset_bits != x &&
373
   test x$ac_cv_sys_file_offset_bits != xno &&
374
   test x$ac_cv_sys_file_offset_bits != xunknown; then
375
  CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits"
376
fi
377
378
if test x$ac_cv_sys_large_files != x &&
379
   test x$ac_cv_sys_large_files != xno &&
380
   test x$ac_cv_sys_large_files != xunknown; then
381
  CPPFLAGS="$CPPFLAGS -D_LARGE_FILES=$ac_cv_sys_large_files"
382
fi
383
384
AX_CHECK_LINK_FLAG([[-Wl,--large-address-aware]], [LDFLAGS="$LDFLAGS -Wl,--large-address-aware"])
385
386
AX_GCC_FUNC_ATTRIBUTE([visibility])
387
AX_GCC_FUNC_ATTRIBUTE([dllexport])
388
AX_GCC_FUNC_ATTRIBUTE([dllimport])
389
390
if test x$use_glibc_compat != xno; then
391
392
  #__fdelt_chk's params and return type have changed from long unsigned int to long int.
393
  # See which one is present here.
394
  AC_MSG_CHECKING(__fdelt_chk type)
395
  AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#ifdef _FORTIFY_SOURCE
396
                    #undef _FORTIFY_SOURCE
397
                  #endif
398
                  #define _FORTIFY_SOURCE 2
399
                  #include <sys/select.h>
400
     extern "C" long unsigned int __fdelt_warn(long unsigned int);]],[[]])],
401
    [ fdelt_type="long unsigned int"],
402
    [ fdelt_type="long int"])
403
  AC_MSG_RESULT($fdelt_type)
404
  AC_DEFINE_UNQUOTED(FDELT_TYPE, $fdelt_type,[parameter and return value type for __fdelt_chk])
405
406
fi
407
408
if test x$use_hardening != xno; then
409
  AX_CHECK_COMPILE_FLAG([-Wstack-protector],[HARDENED_CXXFLAGS="$HARDENED_CXXFLAGS -Wstack-protector"])
410
  AX_CHECK_COMPILE_FLAG([-fstack-protector-all],[HARDENED_CXXFLAGS="$HARDENED_CXXFLAGS -fstack-protector-all"])
411
412
  AX_CHECK_PREPROC_FLAG([-D_FORTIFY_SOURCE=2],[
413
    AX_CHECK_PREPROC_FLAG([-U_FORTIFY_SOURCE],[
414
      HARDENED_CPPFLAGS="$HARDENED_CPPFLAGS -U_FORTIFY_SOURCE"
415
    ])
416
    HARDENED_CPPFLAGS="$HARDENED_CPPFLAGS -D_FORTIFY_SOURCE=2"
417
  ])
418
419
  AX_CHECK_LINK_FLAG([[-Wl,--dynamicbase]], [HARDENED_LDFLAGS="$HARDENED_LDFLAGS -Wl,--dynamicbase"])
420
  AX_CHECK_LINK_FLAG([[-Wl,--nxcompat]], [HARDENED_LDFLAGS="$HARDENED_LDFLAGS -Wl,--nxcompat"])
421
  AX_CHECK_LINK_FLAG([[-Wl,-z,relro]], [HARDENED_LDFLAGS="$HARDENED_LDFLAGS -Wl,-z,relro"])
422
  AX_CHECK_LINK_FLAG([[-Wl,-z,now]], [HARDENED_LDFLAGS="$HARDENED_LDFLAGS -Wl,-z,now"])
423
424
  if test x$TARGET_OS != xwindows; then
425
    # All windows code is PIC, forcing it on just adds useless compile warnings
426
    AX_CHECK_COMPILE_FLAG([-fPIE],[HARDENED_CXXFLAGS="$HARDENED_CXXFLAGS -fPIE"])
427
    AX_CHECK_LINK_FLAG([[-pie]], [HARDENED_LDFLAGS="$HARDENED_LDFLAGS -pie"])
428
  fi
429
430
  case $host in
431
    *mingw*)
432
       AC_CHECK_LIB([ssp],      [main],, AC_MSG_ERROR(lib missing))
433
    ;;
434
  esac
435
436
  CXXFLAGS="$CXXFLAGS $HARDENED_CXXFLAGS"
437
  CPPFLAGS="$CPPFLAGS $HARDENED_CPPFLAGS"
438
  LDFLAGS="$LDFLAGS $HARDENED_LDFLAGS"
439
  OBJCXXFLAGS="$CXXFLAGS"
440
fi
441
442
dnl this flag screws up non-darwin gcc even when the check fails. special-case it.
443
if test x$TARGET_OS = xdarwin; then
444
  AX_CHECK_LINK_FLAG([[-Wl,-dead_strip]], [LDFLAGS="$LDFLAGS -Wl,-dead_strip"])
445
fi
446
447
AC_CHECK_HEADERS([endian.h sys/endian.h byteswap.h stdio.h stdlib.h unistd.h strings.h sys/types.h sys/stat.h sys/select.h sys/prctl.h])
448
AC_SEARCH_LIBS([getaddrinfo_a], [anl], [AC_DEFINE(HAVE_GETADDRINFO_A, 1, [Define this symbol if you have getaddrinfo_a])])
449
AC_SEARCH_LIBS([inet_pton], [nsl resolv], [AC_DEFINE(HAVE_INET_PTON, 1, [Define this symbol if you have inet_pton])])
450
451
AC_CHECK_DECLS([strnlen])
452
453
AC_CHECK_DECLS([le16toh, le32toh, le64toh, htole16, htole32, htole64, be16toh, be32toh, be64toh, htobe16, htobe32, htobe64],,,
454
		[#if HAVE_ENDIAN_H
455
                 #include <endian.h>
456
                 #elif HAVE_SYS_ENDIAN_H
457
                 #include <sys/endian.h>
458
                 #endif])
459
460
AC_CHECK_DECLS([bswap_16, bswap_32, bswap_64],,,
461
		[#if HAVE_BYTESWAP_H
462
                 #include <byteswap.h>
463
                 #endif])
464
465
dnl Check for MSG_NOSIGNAL
466
AC_MSG_CHECKING(for MSG_NOSIGNAL)
467
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/socket.h>]],
468
 [[ int f = MSG_NOSIGNAL; ]])],
469
 [ AC_MSG_RESULT(yes); AC_DEFINE(HAVE_MSG_NOSIGNAL, 1,[Define this symbol if you have MSG_NOSIGNAL]) ],
470
 [ AC_MSG_RESULT(no)]
471
)
472
473
AC_SEARCH_LIBS([clock_gettime],[rt])
474
475
AC_MSG_CHECKING([for visibility attribute])
476
AC_LINK_IFELSE([AC_LANG_SOURCE([
477
  int foo_def( void ) __attribute__((visibility("default")));
478
  int main(){}
479
  ])],
480
  [
481
    AC_DEFINE(HAVE_VISIBILITY_ATTRIBUTE,1,[Define if the visibility attribute is supported.])
482
    AC_MSG_RESULT(yes)
483
  ],
484
  [
485
    AC_MSG_RESULT(no)
486
    if test x$use_reduce_exports = xyes; then
487
      AC_MSG_ERROR([Cannot find a working visibility attribute. Use --disable-reduce-exports.])
488
    fi
489
  ]
490
)
491
492
if test x$use_reduce_exports = xyes; then
493
  AX_CHECK_COMPILE_FLAG([-fvisibility=hidden],[RE_CXXFLAGS="-fvisibility=hidden"],
494
  [AC_MSG_ERROR([Cannot set default symbol visibility. Use --disable-reduce-exports.])])
495
fi
496
497
LEVELDB_CPPFLAGS=
498
LIBLEVELDB=
499
LIBMEMENV=
500
AM_CONDITIONAL([EMBEDDED_LEVELDB],[true])
501
AC_SUBST(LEVELDB_CPPFLAGS)
502
AC_SUBST(LIBLEVELDB)
503
AC_SUBST(LIBMEMENV)
504
505
if test x$enable_wallet != xno; then
506
    dnl Check for libdb_cxx only if wallet enabled
507
    BITCOIN_FIND_BDB48
508
fi
509
510
dnl Check for libminiupnpc (optional)
511
if test x$use_upnp != xno; then
512
  AC_CHECK_HEADERS(
513
    [miniupnpc/miniwget.h miniupnpc/miniupnpc.h miniupnpc/upnpcommands.h miniupnpc/upnperrors.h],
514
    [AC_CHECK_LIB([miniupnpc], [main],[MINIUPNPC_LIBS=-lminiupnpc], [have_miniupnpc=no])],
515
    [have_miniupnpc=no]
516
  )
517
fi
518
519
BITCOIN_QT_INIT
520
521
dnl sets $bitcoin_enable_qt, $bitcoin_enable_qt_test, $bitcoin_enable_qt_dbus
522
BITCOIN_QT_CONFIGURE([$use_pkgconfig], [qt4])
523
524
if test x$build_bitcoin_utils$build_bitcoind$bitcoin_enable_qt$use_tests = xnononono; then
525
    use_boost=no
526
else
527
    use_boost=yes
528
fi
529
530
if test x$use_boost = xyes; then
531
532
dnl Check for boost libs
533
AX_BOOST_BASE
534
AX_BOOST_SYSTEM
535
AX_BOOST_FILESYSTEM
536
AX_BOOST_PROGRAM_OPTIONS
537
AX_BOOST_THREAD
538
AX_BOOST_CHRONO
539
540
541
if test x$use_reduce_exports = xyes; then
542
  AC_MSG_CHECKING([for working boost reduced exports])
543
  TEMP_CPPFLAGS="$CPPFLAGS"
544
  CPPFLAGS="$BOOST_CPPFLAGS $CPPFLAGS"
545
  AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[
546
      @%:@include <boost/version.hpp>
547
    ]], [[
548
      #if BOOST_VERSION >= 104900
549
      // Everything is okay
550
      #else
551
      #  error Boost version is too old
552
      #endif
553
    ]])],[
554
      AC_MSG_RESULT(yes)
555
    ],[
556
    AC_MSG_ERROR([boost versions < 1.49 are known to be broken with reduced exports. Use --disable-reduce-exports.])
557
  ])
558
  CPPFLAGS="$TEMP_CPPFLAGS"
559
fi
560
fi
561
562
if test x$use_reduce_exports = xyes; then
563
    CXXFLAGS="$CXXFLAGS $RE_CXXFLAGS"
564
    AX_CHECK_LINK_FLAG([[-Wl,--exclude-libs,ALL]], [RELDFLAGS="-Wl,--exclude-libs,ALL"])
565
fi
566
567
if test x$use_tests = xyes; then
568
569
  if test x$HEXDUMP = x; then
570
    AC_MSG_ERROR(hexdump is required for tests)
571
  fi
572
573
574
  if test x$use_boost = xyes; then
575
576
  AX_BOOST_UNIT_TEST_FRAMEWORK
577
578
  dnl Determine if -DBOOST_TEST_DYN_LINK is needed
579
  AC_MSG_CHECKING([for dynamic linked boost test])
580
  TEMP_LIBS="$LIBS"
581
  LIBS="$LIBS $BOOST_LDFLAGS $BOOST_UNIT_TEST_FRAMEWORK_LIB"
582
  TEMP_CPPFLAGS="$CPPFLAGS"
583
  CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
584
  AC_LINK_IFELSE([AC_LANG_SOURCE([
585
       #define BOOST_TEST_DYN_LINK
586
       #define BOOST_TEST_MAIN
587
        #include <boost/test/unit_test.hpp>
588
589
       ])],
590
    [AC_MSG_RESULT(yes)]
591
    [TESTDEFS="$TESTDEFS -DBOOST_TEST_DYN_LINK"],
592
    [AC_MSG_RESULT(no)])
593
  LIBS="$TEMP_LIBS"
594
  CPPFLAGS="$TEMP_CPPFLAGS"
595
596
  fi
597
fi
598
599
if test x$use_boost = xyes; then
600
601
BOOST_LIBS="$BOOST_LDFLAGS $BOOST_SYSTEM_LIB $BOOST_FILESYSTEM_LIB $BOOST_PROGRAM_OPTIONS_LIB $BOOST_THREAD_LIB $BOOST_CHRONO_LIB"
602
603
dnl Boost >= 1.50 uses sleep_for rather than the now-deprecated sleep, however
604
dnl it was broken from 1.50 to 1.52 when backed by nanosleep. Use sleep_for if
605
dnl a working version is available, else fall back to sleep. sleep was removed
606
dnl after 1.56.
607
dnl If neither is available, abort.
608
TEMP_LIBS="$LIBS"
609
LIBS="$BOOST_LIBS $LIBS"
610
TEMP_CPPFLAGS="$CPPFLAGS"
611
CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
612
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
613
  #include <boost/thread/thread.hpp>
614
  #include <boost/version.hpp>
615
  ]],[[
616
  #if BOOST_VERSION >= 105000 && (!defined(BOOST_HAS_NANOSLEEP) || BOOST_VERSION >= 105200)
617
      boost::this_thread::sleep_for(boost::chrono::milliseconds(0));
618
  #else
619
   choke me
620
  #endif
621
  ]])],
622
  [boost_sleep=yes;
623
     AC_DEFINE(HAVE_WORKING_BOOST_SLEEP_FOR, 1, [Define this symbol if boost sleep_for works])],
624
  [boost_sleep=no])
625
LIBS="$TEMP_LIBS"
626
CPPFLAGS="$TEMP_CPPFLAGS"
627
628
if test x$boost_sleep != xyes; then
629
TEMP_LIBS="$LIBS"
630
LIBS="$BOOST_LIBS $LIBS"
631
TEMP_CPPFLAGS="$CPPFLAGS"
632
CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
633
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
634
  #include <boost/version.hpp>
635
  #include <boost/thread.hpp>
636
  #include <boost/date_time/posix_time/posix_time_types.hpp>
637
  ]],[[
638
  #if BOOST_VERSION <= 105600
639
      boost::this_thread::sleep(boost::posix_time::milliseconds(0));
640
  #else
641
   choke me
642
  #endif
643
  ]])],
644
  [boost_sleep=yes; AC_DEFINE(HAVE_WORKING_BOOST_SLEEP, 1, [Define this symbol if boost sleep works])],
645
  [boost_sleep=no])
646
LIBS="$TEMP_LIBS"
647
CPPFLAGS="$TEMP_CPPFLAGS"
648
fi
649
650
if test x$boost_sleep != xyes; then
651
  AC_MSG_ERROR(No working boost sleep implementation found.)
652
fi
653
654
fi
655
656
if test x$use_pkgconfig = xyes; then
657
658
  if test x"$PKG_CONFIG" = "x"; then
659
    AC_MSG_ERROR(pkg-config not found.)
660
  fi
661
662
  : #NOP
663
  m4_ifdef(
664
    [PKG_CHECK_MODULES],
665
    [
666
      PKG_CHECK_MODULES([SSL], [libssl],, [AC_MSG_ERROR(openssl  not found.)])
667
      PKG_CHECK_MODULES([CRYPTO], [libcrypto],,[AC_MSG_ERROR(libcrypto  not found.)])
668
      BITCOIN_QT_CHECK([PKG_CHECK_MODULES([PROTOBUF], [protobuf], [have_protobuf=yes], [BITCOIN_QT_FAIL(libprotobuf not found)])])
669
      if test x$use_qr != xno; then
670
        BITCOIN_QT_CHECK([PKG_CHECK_MODULES([QR], [libqrencode], [have_qrencode=yes], [have_qrencode=no])])
671
      fi
672
      PKG_CHECK_MODULES([CURL], [libcurl],,[AC_MSG_ERROR(libcurl not found)])
673
    ]
674
  )
675
else
676
  AC_CHECK_HEADER([openssl/crypto.h],,AC_MSG_ERROR(libcrypto headers missing))
677
  AC_CHECK_LIB([crypto],      [main],CRYPTO_LIBS=-lcrypto, AC_MSG_ERROR(libcrypto missing))
678
679
  AC_CHECK_HEADER([openssl/ssl.h],, AC_MSG_ERROR(libssl headers missing),)
680
  AC_CHECK_LIB([ssl],         [main],SSL_LIBS=-lssl, AC_MSG_ERROR(libssl missing))
681
682
  BITCOIN_QT_CHECK(AC_CHECK_LIB([protobuf] ,[main],[PROTOBUF_LIBS=-lprotobuf], BITCOIN_QT_FAIL(libprotobuf not found)))
683
  if test x$use_qr != xno; then
684
    BITCOIN_QT_CHECK([AC_CHECK_LIB([qrencode], [main],[QR_LIBS=-lqrencode], [have_qrencode=no])])
685
    BITCOIN_QT_CHECK([AC_CHECK_HEADER([qrencode.h],, have_qrencode=no)])
686
  fi
687
688
  AC_CHECK_HEADER([curl/curl.h],,AC_MSG_ERROR(libcurl headers missing))
689
  AC_CHECK_LIB([curl], [main],CURL_LIBS=-lcurl, AC_MSG_ERROR(libcurl missing))
690
fi
691
692
AC_CHECK_LIB([crypto],[RAND_egd],[],[
693
  AC_ARG_WITH([libressl],
694
    [AS_HELP_STRING([--with-libressl],[Build with system LibreSSL (default is no; DANGEROUS; NOT SUPPORTED)])],
695
    [AC_MSG_WARN([Detected LibreSSL: This is NOT supported, and may break consensus compatibility!])],
696
    [AC_MSG_ERROR([Detected LibreSSL: This is NOT supported, and may break consensus compatibility!])]
697
  )
698
])
699
700
CFLAGS_TEMP="$CFLAGS"
701
LIBS_TEMP="$LIBS"
702
CFLAGS="$CFLAGS $SSL_CFLAGS $CRYPTO_CFLAGS"
703
LIBS="$LIBS $SSL_LIBS $CRYPTO_LIBS"
704
AC_CHECK_HEADER([openssl/ec.h],, AC_MSG_ERROR(OpenSSL ec header missing),)
705
CFLAGS="$CFLAGS_TEMP"
706
LIBS="$LIBS_TEMP"
707
708
BITCOIN_QT_PATH_PROGS([PROTOC], [protoc],$protoc_bin_path)
709
710
AC_MSG_CHECKING([whether to build bitcoind])
711
AM_CONDITIONAL([BUILD_BITCOIND], [test x$build_bitcoind = xyes])
712
AC_MSG_RESULT($build_bitcoind)
713
714
AC_MSG_CHECKING([whether to build utils (bitcoin-cli bitcoin-tx)])
715
AM_CONDITIONAL([BUILD_BITCOIN_UTILS], [test x$build_bitcoin_utils = xyes])
716
AC_MSG_RESULT($build_bitcoin_utils)
717
718
AC_MSG_CHECKING([whether to build libraries])
719
AM_CONDITIONAL([BUILD_BITCOIN_LIBS], [test x$build_bitcoin_libs = xyes])
720
if test x$build_bitcoin_libs = xyes; then
721
  AC_DEFINE(HAVE_CONSENSUS_LIB, 1, [Define this symbol if the consensus lib has been built])
722
  AC_CONFIG_FILES([libbitcoinconsensus.pc:libbitcoinconsensus.pc.in])
723
fi
724
AC_MSG_RESULT($build_bitcoin_libs)
725
726
AC_LANG_POP
727
728
if test "x$use_ccache" != "xno"; then
729
  AC_MSG_CHECKING(if ccache should be used)
730
  if test x$CCACHE = x; then
731
    if test "x$use_ccache" = "xyes"; then
732
      AC_MSG_ERROR([ccache not found.]);
733
    else
734
      use_ccache=no
735
    fi
736
  else
737
    use_ccache=yes
738
    CC="$ac_cv_path_CCACHE $CC"
739
    CXX="$ac_cv_path_CCACHE $CXX"
740
  fi
741
  AC_MSG_RESULT($use_ccache)
742
fi
743
if test "x$use_ccache" = "xyes"; then
744
    AX_CHECK_PREPROC_FLAG([-Qunused-arguments],[CPPFLAGS="-Qunused-arguments $CPPFLAGS"])
745
fi
746
747
dnl enable wallet
748
AC_MSG_CHECKING([if wallet should be enabled])
749
if test x$enable_wallet != xno; then
750
  AC_MSG_RESULT(yes)
751
  AC_DEFINE_UNQUOTED([ENABLE_WALLET],[1],[Define to 1 to enable wallet functions])
752
753
else
754
  AC_MSG_RESULT(no)
755
fi
756
757
dnl enable upnp support
758
AC_MSG_CHECKING([whether to build with support for UPnP])
759
if test x$have_miniupnpc = xno; then
760
  if test x$use_upnp = xyes; then
761
     AC_MSG_ERROR("UPnP requested but cannot be built. use --without-miniupnpc")
762
  fi
763
  AC_MSG_RESULT(no)
764
else
765
  if test x$use_upnp != xno; then
766
    AC_MSG_RESULT(yes)
767
    AC_MSG_CHECKING([whether to build with UPnP enabled by default])
768
    use_upnp=yes
769
    upnp_setting=0
770
    if test x$use_upnp_default != xno; then
771
      use_upnp_default=yes
772
      upnp_setting=1
773
    fi
774
    AC_MSG_RESULT($use_upnp_default)
775
    AC_DEFINE_UNQUOTED([USE_UPNP],[$upnp_setting],[UPnP support not compiled if undefined, otherwise value (0 or 1) determines default state])
776
    if test x$TARGET_OS = xwindows; then
777
      MINIUPNPC_CPPFLAGS="-DSTATICLIB -DMINIUPNP_STATICLIB"
778
    fi
779
  else
780
    AC_MSG_RESULT(no)
781
  fi
782
fi
783
784
dnl these are only used when qt is enabled
785
if test x$bitcoin_enable_qt != xno; then
786
  BUILD_QT=qt
787
  dnl enable dbus support
788
  AC_MSG_CHECKING([whether to build GUI with support for D-Bus])
789
  if test x$bitcoin_enable_qt_dbus != xno; then
790
    AC_DEFINE([USE_DBUS],[1],[Define if dbus support should be compiled in])
791
  fi
792
  AC_MSG_RESULT($bitcoin_enable_qt_dbus)
793
794
  dnl enable qr support
795
  AC_MSG_CHECKING([whether to build GUI with support for QR codes])
796
  if test x$have_qrencode = xno; then
797
    if test x$use_qr = xyes; then
798
     AC_MSG_ERROR("QR support requested but cannot be built. use --without-qrencode")
799
    fi
800
    AC_MSG_RESULT(no)
801
  else
802
    if test x$use_qr != xno; then
803
      AC_MSG_RESULT(yes)
804
      AC_DEFINE([USE_QRCODE],[1],[Define if QR support should be compiled in])
805
      use_qr=yes
806
    else
807
      AC_MSG_RESULT(no)
808
    fi
809
  fi
810
811
  if test x$XGETTEXT = x; then
812
    AC_MSG_WARN("xgettext is required to update qt translations")
813
  fi
814
815
  AC_MSG_CHECKING([whether to build test_bitcoin-qt])
816
  if test x$use_tests$bitcoin_enable_qt_test = xyesyes; then
817
    AC_MSG_RESULT([yes])
818
    BUILD_TEST_QT="test"
819
  else
820
    AC_MSG_RESULT([no])
821
  fi
822
fi
823
824
AC_MSG_CHECKING([whether to build test_bitcoin])
825
if test x$use_tests = xyes; then
826
  AC_MSG_RESULT([yes])
827
  BUILD_TEST="test"
828
else
829
  AC_MSG_RESULT([no])
830
fi
831
832
AC_MSG_CHECKING([whether to reduce exports])
833
if test x$use_reduce_exports = xyes; then
834
  AC_MSG_RESULT([yes])
835
else
836
  AC_MSG_RESULT([no])
837
fi
838
839
if test x$build_bitcoin_utils$build_bitcoin_libs$build_bitcoind$bitcoin_enable_qt$use_tests = xnonononono; then
840
  AC_MSG_ERROR([No targets! Please specify at least one of: --with-utils --with-libs --with-daemon --with-gui or --enable-tests])
841
fi
842
843
AM_CONDITIONAL([TARGET_DARWIN], [test x$TARGET_OS = xdarwin])
844
AM_CONDITIONAL([BUILD_DARWIN], [test x$BUILD_OS = xdarwin])
845
AM_CONDITIONAL([TARGET_WINDOWS], [test x$TARGET_OS = xwindows])
846
AM_CONDITIONAL([ENABLE_WALLET],[test x$enable_wallet = xyes])
847
AM_CONDITIONAL([ENABLE_TESTS],[test x$use_tests = xyes])
848
AM_CONDITIONAL([ENABLE_QT],[test x$bitcoin_enable_qt = xyes])
849
AM_CONDITIONAL([ENABLE_QT_TESTS],[test x$use_tests$bitcoin_enable_qt_test = xyesyes])
850
AM_CONDITIONAL([USE_QRCODE], [test x$use_qr = xyes])
851
AM_CONDITIONAL([USE_LCOV],[test x$use_lcov = xyes])
852
AM_CONDITIONAL([USE_COMPARISON_TOOL],[test x$use_comparison_tool != xno])
853
AM_CONDITIONAL([USE_COMPARISON_TOOL_REORG_TESTS],[test x$use_comparison_tool_reorg_test != xno])
854
AM_CONDITIONAL([GLIBC_BACK_COMPAT],[test x$use_glibc_compat = xyes])
855
856
AC_DEFINE(CLIENT_VERSION_MAJOR, _CLIENT_VERSION_MAJOR, [Major version])
857
AC_DEFINE(CLIENT_VERSION_MINOR, _CLIENT_VERSION_MINOR, [Minor version])
858
AC_DEFINE(CLIENT_VERSION_REVISION, _CLIENT_VERSION_REVISION, [Build revision])
859
AC_DEFINE(CLIENT_VERSION_BUILD, _CLIENT_VERSION_BUILD, [Version Build])
860
AC_DEFINE(CLIENT_VERSION_XT_SUBVER, "_CLIENT_VERSION_XT_SUBVER", [XT subversion])
861
AC_DEFINE(CLIENT_VERSION_IS_RELEASE, _CLIENT_VERSION_IS_RELEASE, [Version is release])
862
AC_DEFINE(COPYRIGHT_YEAR, _COPYRIGHT_YEAR, [Version is release])
863
AC_SUBST(CLIENT_VERSION_MAJOR, _CLIENT_VERSION_MAJOR)
864
AC_SUBST(CLIENT_VERSION_MINOR, _CLIENT_VERSION_MINOR)
865
AC_SUBST(CLIENT_VERSION_REVISION, _CLIENT_VERSION_REVISION)
866
AC_SUBST(CLIENT_VERSION_BUILD, _CLIENT_VERSION_BUILD)
867
AC_SUBST(CLIENT_VERSION_IS_RELEASE, _CLIENT_VERSION_IS_RELEASE)
868
AC_SUBST(CLIENT_VERSION_XT_SUBVER, _CLIENT_VERSION_XT_SUBVER)
869
AC_SUBST(COPYRIGHT_YEAR, _COPYRIGHT_YEAR)
870
871
AC_SUBST(RELDFLAGS)
872
AC_SUBST(LIBTOOL_APP_LDFLAGS)
873
AC_SUBST(USE_UPNP)
874
AC_SUBST(USE_QRCODE)
875
AC_SUBST(BOOST_LIBS)
876
AC_SUBST(TESTDEFS)
877
AC_SUBST(LEVELDB_TARGET_FLAGS)
878
AC_SUBST(BUILD_TEST)
879
AC_SUBST(BUILD_QT)
880
AC_SUBST(BUILD_TEST_QT)
881
AC_SUBST(MINIUPNPC_CPPFLAGS)
882
AC_SUBST(MINIUPNPC_LIBS)
883
AC_SUBST(CURL_FLAGS)
884
AC_SUBST(CURL_LIBS)
885
AC_CONFIG_FILES([Makefile src/Makefile share/setup.nsi share/qt/Info.plist src/test/buildenv.py])
886
AC_CONFIG_FILES([qa/pull-tester/run-bitcoind-for-test.sh],[chmod +x qa/pull-tester/run-bitcoind-for-test.sh])
887
AC_CONFIG_FILES([qa/pull-tester/tests-config.sh],[chmod +x qa/pull-tester/tests-config.sh])
888
889
dnl boost's m4 checks do something really nasty: they export these vars. As a
890
dnl result, they leak into secp256k1's configure and crazy things happen.
891
dnl Until this is fixed upstream and we've synced, we'll just un-export them.
892
CPPFLAGS_TEMP="$CPPFLAGS"
893
unset CPPFLAGS
894
CPPFLAGS="$CPPFLAGS_TEMP"
895
896
LDFLAGS_TEMP="$LDFLAGS"
897
unset LDFLAGS
898
LDFLAGS="$LDFLAGS_TEMP"
899
900
LIBS_TEMP="$LIBS"
901
unset LIBS
902
LIBS="$LIBS_TEMP"
903
904
PKGCONFIG_PATH_TEMP="$PKG_CONFIG_PATH"
905
unset PKG_CONFIG_PATH
906
PKG_CONFIG_PATH="$PKGCONFIG_PATH_TEMP"
907
908
PKGCONFIG_LIBDIR_TEMP="$PKG_CONFIG_LIBDIR"
909
unset PKG_CONFIG_LIBDIR
910
PKG_CONFIG_LIBDIR="$PKGCONFIG_LIBDIR_TEMP"
911
912
ac_configure_args="${ac_configure_args} --disable-shared --with-pic --with-bignum=no --enable-module-recovery"
913
AC_CONFIG_SUBDIRS([src/secp256k1])
914
915
AC_OUTPUT
916
917
dnl Taken from https://wiki.debian.org/RpathIssue
918
case $host in
919
   *-*-linux-gnu)
920
     AC_MSG_RESULT([Fixing libtool for -rpath problems.])
921
     sed < libtool > libtool-2 \
922
     's/^hardcode_libdir_flag_spec.*$'/'hardcode_libdir_flag_spec=" -D__LIBTOOL_IS_A_FOOL__ "/'
923
     mv libtool-2 libtool
924
     chmod 755 libtool
925
   ;;
926
esac
(-)/root/bitcoinxt-0.11E/configure.ac.rej (+13 lines)
Line 0 Link Here
1
--- configure.ac
2
+++ configure.ac
3
@@ -962,8 +1029,10 @@ PKGCONFIG_LIBDIR_TEMP="$PKG_CONFIG_LIBDIR"
4
 unset PKG_CONFIG_LIBDIR
5
 PKG_CONFIG_LIBDIR="$PKGCONFIG_LIBDIR_TEMP"
6
 
7
+if test x$system_libsecp256k1 = xno; then
8
 ac_configure_args="${ac_configure_args} --disable-shared --with-pic --with-bignum=no"
9
 AC_CONFIG_SUBDIRS([src/secp256k1])
10
+fi
11
 
12
 AC_OUTPUT
13
 
(-)/root/bitcoinxt-0.11E/qa/pull-tester/rpc-tests.sh (-1 / +1 lines)
Lines 64-70 Link Here
64
extArg="-extended"
64
extArg="-extended"
65
passOn=${@#$extArg}
65
passOn=${@#$extArg}
66
66
67
if [ "x${ENABLE_BITCOIND}${ENABLE_UTILS}${ENABLE_WALLET}" = "x111" ]; then
67
if [ "x${ENABLE_BITCOIND}${ENABLE_CLI}${ENABLE_WALLET}" = "x111" ]; then
68
    for (( i = 0; i < ${#testScripts[@]}; i++ ))
68
    for (( i = 0; i < ${#testScripts[@]}; i++ ))
69
    do
69
    do
70
        if [ -z "$1" ] || [ "${1:0:1}" == "-" ] || [ "$1" == "${testScripts[$i]}" ] || [ "$1.py" == "${testScripts[$i]}" ]
70
        if [ -z "$1" ] || [ "${1:0:1}" == "-" ] || [ "$1" == "${testScripts[$i]}" ] || [ "$1.py" == "${testScripts[$i]}" ]
(-)/root/bitcoinxt-0.11E/qa/pull-tester/rpc-tests.sh.orig (+86 lines)
Line 0 Link Here
1
#!/bin/bash
2
set -e
3
4
CURDIR=$(cd $(dirname "$0"); pwd)
5
# Get BUILDDIR and REAL_BITCOIND
6
. "${CURDIR}/tests-config.sh"
7
8
export BITCOINCLI=${BUILDDIR}/qa/pull-tester/run-bitcoin-cli
9
export BITCOIND=${REAL_BITCOIND}
10
11
if [ "x${EXEEXT}" = "x.exe" ]; then
12
  echo "Win tests currently disabled"
13
  exit 0
14
fi
15
16
#Run the tests
17
18
testScripts=(
19
    'wallet.py'
20
    'listtransactions.py'
21
    'mempool_resurrect_test.py'
22
    'txn_clone.py'
23
    'txn_doublespend.py'
24
    'txn_doublespendrelay.py'
25
    'getchaintips.py'
26
    'rawtransactions.py'
27
    'rest.py'
28
    'mempool_spendcoinbase.py'
29
    'mempool_coinbase_spends.py'
30
    'httpbasics.py'
31
    'zapwallettxes.py'
32
    'proxy_test.py'
33
    'merkle_blocks.py'
34
    'signrawtransactions.py'
35
    'walletbackup.py'
36
);
37
testScriptsExt=(
38
    'bigblocks.py'
39
    'bipdersig-p2p.py'
40
    'bip65-cltv-p2p.py'
41
    'bip65-cltv.py'
42
    'getblocktemplate_longpoll.py'
43
    'getblocktemplate_proposals.py'
44
    'txn_clone.py --mineblock'
45
    'txn_doublespend.py --mineblock'
46
    'mempool_limit.py'
47
    'pruning.py'
48
    'forknotify.py'
49
    'invalidateblock.py'
50
    'keypool.py'
51
    'receivedby.py'
52
    'reindex.py'
53
    'rpcbind_test.py'
54
#   'script_test.py'
55
    'smartfees.py'
56
    'maxblocksinflight.py'
57
    'invalidblockrequest.py'
58
    'rawtransactions.py'
59
#    'forknotify.py'
60
    'p2p-acceptblock.py'
61
    'mempool_packages.py'
62
);
63
64
extArg="-extended"
65
passOn=${@#$extArg}
66
67
if [ "x${ENABLE_BITCOIND}${ENABLE_UTILS}${ENABLE_WALLET}" = "x111" ]; then
68
    for (( i = 0; i < ${#testScripts[@]}; i++ ))
69
    do
70
        if [ -z "$1" ] || [ "${1:0:1}" == "-" ] || [ "$1" == "${testScripts[$i]}" ] || [ "$1.py" == "${testScripts[$i]}" ]
71
        then
72
            echo -e "Running testscript \033[1m${testScripts[$i]}...\033[0m"
73
            ${BUILDDIR}/qa/rpc-tests/${testScripts[$i]} --srcdir "${BUILDDIR}/src" ${passOn}
74
        fi
75
    done
76
    for (( i = 0; i < ${#testScriptsExt[@]}; i++ ))
77
    do
78
        if [ "$1" == $extArg ] || [ "$1" == "${testScriptsExt[$i]}" ] || [ "$1.py" == "${testScriptsExt[$i]}" ]
79
        then
80
            echo -e "Running \033[1m2nd level\033[0m testscript \033[1m${testScriptsExt[$i]}...\033[0m"
81
            ${BUILDDIR}/qa/rpc-tests/${testScriptsExt[$i]} --srcdir "${BUILDDIR}/src" ${passOn}
82
        fi
83
    done
84
else
85
  echo "No rpc tests to run. Wallet, utils, and bitcoind must all be enabled"
86
fi
(-)/root/bitcoinxt-0.11E/qa/pull-tester/tests-config.sh.in (-1 / +1 lines)
Lines 8-14 Link Here
8
8
9
# These will turn into comments if they were disabled when configuring.
9
# These will turn into comments if they were disabled when configuring.
10
@ENABLE_WALLET_TRUE@ENABLE_WALLET=1
10
@ENABLE_WALLET_TRUE@ENABLE_WALLET=1
11
@BUILD_BITCOIN_UTILS_TRUE@ENABLE_UTILS=1
11
@BUILD_BITCOIN_CLI_TRUE@ENABLE_CLI=1
12
@BUILD_BITCOIND_TRUE@ENABLE_BITCOIND=1
12
@BUILD_BITCOIND_TRUE@ENABLE_BITCOIND=1
13
13
14
REAL_BITCOIND="$BUILDDIR/src/bitcoind${EXEEXT}"
14
REAL_BITCOIND="$BUILDDIR/src/bitcoind${EXEEXT}"
(-)/root/bitcoinxt-0.11E/src/Makefile.am (-3 / +14 lines)
Lines 1-4 Link Here
1
if EMBEDDED_LIBSECP256K1
1
DIST_SUBDIRS = secp256k1
2
DIST_SUBDIRS = secp256k1
3
endif
2
AM_LDFLAGS = $(PTHREAD_CFLAGS) $(LIBTOOL_LDFLAGS)
4
AM_LDFLAGS = $(PTHREAD_CFLAGS) $(LIBTOOL_LDFLAGS)
3
5
4
6
Lines 20-26 Link Here
20
BITCOIN_CONFIG_INCLUDES=-I$(builddir)/config
22
BITCOIN_CONFIG_INCLUDES=-I$(builddir)/config
21
BITCOIN_INCLUDES=-I$(builddir) -I$(builddir)/obj $(BOOST_CPPFLAGS) $(LEVELDB_CPPFLAGS) $(CRYPTO_CFLAGS) $(SSL_CFLAGS) $(CURL_CFLAGS)
23
BITCOIN_INCLUDES=-I$(builddir) -I$(builddir)/obj $(BOOST_CPPFLAGS) $(LEVELDB_CPPFLAGS) $(CRYPTO_CFLAGS) $(SSL_CFLAGS) $(CURL_CFLAGS)
22
24
23
BITCOIN_INCLUDES += -I$(srcdir)/secp256k1/include
25
BITCOIN_INCLUDES += $(libsecp256k1_CFLAGS)
24
26
25
LIBBITCOIN_SERVER=libbitcoin_server.a
27
LIBBITCOIN_SERVER=libbitcoin_server.a
26
LIBBITCOIN_WALLET=libbitcoin_wallet.a
28
LIBBITCOIN_WALLET=libbitcoin_wallet.a
Lines 30-39 Link Here
30
LIBBITCOIN_CRYPTO=crypto/libbitcoin_crypto.a
32
LIBBITCOIN_CRYPTO=crypto/libbitcoin_crypto.a
31
LIBBITCOIN_UNIVALUE=univalue/libbitcoin_univalue.a
33
LIBBITCOIN_UNIVALUE=univalue/libbitcoin_univalue.a
32
LIBBITCOINQT=qt/libbitcoinqt.a
34
LIBBITCOINQT=qt/libbitcoinqt.a
35
if EMBEDDED_LIBSECP256K1
33
LIBSECP256K1=secp256k1/libsecp256k1.la
36
LIBSECP256K1=secp256k1/libsecp256k1.la
37
else
38
LIBSECP256K1=$(libsecp256k1_LIBS)
39
endif
34
40
41
if EMBEDDED_LIBSECP256K1
35
$(LIBSECP256K1): $(wildcard secp256k1/src/*) $(wildcard secp256k1/include/*)
42
$(LIBSECP256K1): $(wildcard secp256k1/src/*) $(wildcard secp256k1/include/*)
36
	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
43
	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
44
endif
37
45
38
# Make is not made aware of per-object dependencies to avoid limiting building parallelization
46
# Make is not made aware of per-object dependencies to avoid limiting building parallelization
39
# But to build the less dependent modules first, we manually select their order here:
47
# But to build the less dependent modules first, we manually select their order here:
Lines 63-70 Link Here
63
  bin_PROGRAMS += bitcoind
71
  bin_PROGRAMS += bitcoind
64
endif
72
endif
65
73
66
if BUILD_BITCOIN_UTILS
74
if BUILD_BITCOIN_CLI
67
  bin_PROGRAMS += bitcoin-cli bitcoin-tx
75
  bin_PROGRAMS += bitcoin-cli
76
endif
77
if BUILD_BITCOIN_TX
78
  bin_PROGRAMS += bitcoin-tx
68
endif
79
endif
69
80
70
.PHONY: FORCE
81
.PHONY: FORCE
(-)/root/bitcoinxt-0.11E/src/Makefile.am.orig (+448 lines)
Line 0 Link Here
1
DIST_SUBDIRS = secp256k1
2
AM_LDFLAGS = $(PTHREAD_CFLAGS) $(LIBTOOL_LDFLAGS)
3
4
5
if EMBEDDED_LEVELDB
6
LEVELDB_CPPFLAGS += -I$(srcdir)/leveldb/include
7
LEVELDB_CPPFLAGS += -I$(srcdir)/leveldb/helpers/memenv
8
LIBLEVELDB += $(top_srcdir)/src/leveldb/libleveldb.a
9
LIBMEMENV  += $(top_srcdir)/src/leveldb/libmemenv.a
10
11
# NOTE: This dependency is not strictly necessary, but without it make may try to build both in parallel, which breaks the LevelDB build system in a race
12
$(LIBLEVELDB): $(LIBMEMENV)
13
14
$(LIBLEVELDB) $(LIBMEMENV):
15
	@echo "Building LevelDB ..." && $(MAKE) -C $(@D) $(@F) CXX="$(CXX)" \
16
	  CC="$(CC)" PLATFORM=$(TARGET_OS) AR="$(AR)" $(LEVELDB_TARGET_FLAGS) \
17
          OPT="$(CXXFLAGS) $(CPPFLAGS) -D__STDC_LIMIT_MACROS"
18
endif
19
20
BITCOIN_CONFIG_INCLUDES=-I$(builddir)/config
21
BITCOIN_INCLUDES=-I$(builddir) -I$(builddir)/obj $(BOOST_CPPFLAGS) $(LEVELDB_CPPFLAGS) $(CRYPTO_CFLAGS) $(SSL_CFLAGS) $(CURL_CFLAGS)
22
23
BITCOIN_INCLUDES += -I$(srcdir)/secp256k1/include
24
25
LIBBITCOIN_SERVER=libbitcoin_server.a
26
LIBBITCOIN_WALLET=libbitcoin_wallet.a
27
LIBBITCOIN_COMMON=libbitcoin_common.a
28
LIBBITCOIN_CLI=libbitcoin_cli.a
29
LIBBITCOIN_UTIL=libbitcoin_util.a
30
LIBBITCOIN_CRYPTO=crypto/libbitcoin_crypto.a
31
LIBBITCOIN_UNIVALUE=univalue/libbitcoin_univalue.a
32
LIBBITCOINQT=qt/libbitcoinqt.a
33
LIBSECP256K1=secp256k1/libsecp256k1.la
34
35
$(LIBSECP256K1): $(wildcard secp256k1/src/*) $(wildcard secp256k1/include/*)
36
	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F)
37
38
# Make is not made aware of per-object dependencies to avoid limiting building parallelization
39
# But to build the less dependent modules first, we manually select their order here:
40
EXTRA_LIBRARIES = \
41
  crypto/libbitcoin_crypto.a \
42
  libbitcoin_util.a \
43
  libbitcoin_common.a \
44
  univalue/libbitcoin_univalue.a \
45
  libbitcoin_server.a \
46
  libbitcoin_cli.a
47
if ENABLE_WALLET
48
BITCOIN_INCLUDES += $(BDB_CPPFLAGS)
49
EXTRA_LIBRARIES += libbitcoin_wallet.a
50
endif
51
52
if BUILD_BITCOIN_LIBS
53
lib_LTLIBRARIES = libbitcoinconsensus.la
54
LIBBITCOIN_CONSENSUS=libbitcoinconsensus.la
55
else
56
LIBBITCOIN_CONSENSUS=
57
endif
58
59
bin_PROGRAMS =
60
TESTS =
61
62
if BUILD_BITCOIND
63
  bin_PROGRAMS += bitcoind
64
endif
65
66
if BUILD_BITCOIN_UTILS
67
  bin_PROGRAMS += bitcoin-cli bitcoin-tx
68
endif
69
70
.PHONY: FORCE
71
# bitcoin core #
72
BITCOIN_CORE_H = \
73
  addrman.h \
74
  alert.h \
75
  amount.h \
76
  arith_uint256.h \
77
  base58.h \
78
  bloom.h \
79
  chain.h \
80
  chainparams.h \
81
  chainparamsbase.h \
82
  chainparamsseeds.h \
83
  checkpoints.h \
84
  checkqueue.h \
85
  clientversion.h \
86
  coincontrol.h \
87
  coins.h \
88
  compat.h \
89
  compat/byteswap.h \
90
  compat/endian.h \
91
  compat/sanity.h \
92
  compressor.h \
93
  consensus/consensus.h \
94
  consensus/params.h \
95
  consensus/validation.h \
96
  core_io.h \
97
  curl_wrapper.h \
98
  core_memusage.h \
99
  hash.h \
100
  inflightindex.h \
101
  init.h \
102
  ipgroups.h \
103
  key.h \
104
  keystore.h \
105
  leakybucket.h \
106
  leveldbwrapper.h \
107
  limitedmap.h \
108
  main.h \
109
  memusage.h \
110
  merkleblock.h \
111
  miner.h \
112
  net.h \
113
  netbase.h \
114
  noui.h \
115
  options.h \
116
  policy/fees.h \
117
  pow.h \
118
  primitives/block.h \
119
  primitives/transaction.h \
120
  process_merkleblock.h \
121
  protocol.h \
122
  pubkey.h \
123
  random.h \
124
  rpcclient.h \
125
  rpcprotocol.h \
126
  rpcserver.h \
127
  scheduler.h \
128
  script/interpreter.h \
129
  script/script.h \
130
  script/script_error.h \
131
  script/sigcache.h \
132
  script/sign.h \
133
  script/standard.h \
134
  serialize.h \
135
  streams.h \
136
  support/allocators/secure.h \
137
  support/allocators/zeroafterfree.h \
138
  support/cleanse.h \
139
  support/pagelocker.h \
140
  sync.h \
141
  thinblockbuilder.h \
142
  thinblockconcluder.h \
143
  threadsafety.h \
144
  timedata.h \
145
  tinyformat.h \
146
  torips.h \
147
  txdb.h \
148
  txmempool.h \
149
  ui_interface.h \
150
  uint256.h \
151
  undo.h \
152
  util.h \
153
  utilmoneystr.h \
154
  utilstrencodings.h \
155
  utiltime.h \
156
  validationinterface.h \
157
  version.h \
158
  wallet/crypter.h \
159
  wallet/db.h \
160
  wallet/wallet.h \
161
  wallet/wallet_ismine.h \
162
  wallet/walletdb.h
163
164
JSON_H = \
165
  json/json_spirit.h \
166
  json/json_spirit_error_position.h \
167
  json/json_spirit_reader.h \
168
  json/json_spirit_reader_template.h \
169
  json/json_spirit_stream_reader.h \
170
  json/json_spirit_utils.h \
171
  json/json_spirit_value.h \
172
  json/json_spirit_writer.h \
173
  json/json_spirit_writer_template.h
174
175
obj/build.h: FORCE
176
	@$(MKDIR_P) $(builddir)/obj
177
	@$(top_srcdir)/share/genbuild.sh $(abs_top_builddir)/src/obj/build.h \
178
	  $(abs_top_srcdir)
179
libbitcoin_util_a-clientversion.$(OBJEXT): obj/build.h
180
181
# server: shared between bitcoind and bitcoin-qt
182
libbitcoin_server_a_CPPFLAGS = $(BITCOIN_INCLUDES) $(MINIUPNPC_CPPFLAGS)
183
libbitcoin_server_a_SOURCES = \
184
  addrman.cpp \
185
  alert.cpp \
186
  bloom.cpp \
187
  chain.cpp \
188
  checkpoints.cpp \
189
  curl_wrapper.cpp \
190
  inflightindex.cpp \
191
  init.cpp \
192
  ipgroups.cpp \
193
  leakybucket.cpp \
194
  leveldbwrapper.cpp \
195
  main.cpp \
196
  merkleblock.cpp \
197
  miner.cpp \
198
  net.cpp \
199
  noui.cpp \
200
  options.cpp \
201
  policy/fees.cpp \
202
  pow.cpp \
203
  process_merkleblock.cpp \
204
  rest.cpp \
205
  rpcblockchain.cpp \
206
  rpcmining.cpp \
207
  rpcmisc.cpp \
208
  rpcnet.cpp \
209
  rpcrawtransaction.cpp \
210
  rpcserver.cpp \
211
  script/sigcache.cpp \
212
  thinblockbuilder.cpp \
213
  thinblockconcluder.cpp \
214
  timedata.cpp \
215
  txdb.cpp \
216
  txmempool.cpp \
217
  validationinterface.cpp \
218
  $(JSON_H) \
219
  $(BITCOIN_CORE_H)
220
221
# wallet: shared between bitcoind and bitcoin-qt, but only linked
222
# when wallet enabled
223
libbitcoin_wallet_a_CPPFLAGS = $(BITCOIN_INCLUDES)
224
libbitcoin_wallet_a_SOURCES = \
225
  wallet/crypter.cpp \
226
  wallet/db.cpp \
227
  wallet/rpcdump.cpp \
228
  wallet/rpcwallet.cpp \
229
  wallet/wallet.cpp \
230
  wallet/wallet_ismine.cpp \
231
  wallet/walletdb.cpp \
232
  $(BITCOIN_CORE_H)
233
234
# crypto primitives library
235
crypto_libbitcoin_crypto_a_CPPFLAGS = $(BITCOIN_CONFIG_INCLUDES)
236
crypto_libbitcoin_crypto_a_SOURCES = \
237
  crypto/common.h \
238
  crypto/hmac_sha256.cpp \
239
  crypto/hmac_sha256.h \
240
  crypto/hmac_sha512.cpp \
241
  crypto/hmac_sha512.h \
242
  crypto/ripemd160.cpp \
243
  crypto/ripemd160.h \
244
  crypto/sha1.cpp \
245
  crypto/sha1.h \
246
  crypto/sha256.cpp \
247
  crypto/sha256.h \
248
  crypto/sha512.cpp \
249
  crypto/sha512.h
250
251
# univalue JSON library
252
univalue_libbitcoin_univalue_a_SOURCES = \
253
  univalue/univalue.cpp \
254
  univalue/univalue.h \
255
  univalue/univalue_escapes.h \
256
  univalue/univalue_read.cpp \
257
  univalue/univalue_write.cpp
258
259
# common: shared between bitcoind, and bitcoin-qt and non-server tools
260
libbitcoin_common_a_CPPFLAGS = $(BITCOIN_INCLUDES)
261
libbitcoin_common_a_SOURCES = \
262
  amount.cpp \
263
  arith_uint256.cpp \
264
  base58.cpp \
265
  chainparams.cpp \
266
  coins.cpp \
267
  compressor.cpp \
268
  core_read.cpp \
269
  core_write.cpp \
270
  hash.cpp \
271
  key.cpp \
272
  keystore.cpp \
273
  netbase.cpp \
274
  primitives/block.cpp \
275
  primitives/transaction.cpp \
276
  protocol.cpp \
277
  pubkey.cpp \
278
  scheduler.cpp \
279
  script/interpreter.cpp \
280
  script/script.cpp \
281
  script/script_error.cpp \
282
  script/sign.cpp \
283
  script/standard.cpp \
284
  $(BITCOIN_CORE_H)
285
286
# util: shared between all executables.
287
# This library *must* be included to make sure that the glibc
288
# backward-compatibility objects and their sanity checks are linked.
289
libbitcoin_util_a_CPPFLAGS = $(BITCOIN_INCLUDES)
290
libbitcoin_util_a_SOURCES = \
291
  support/pagelocker.cpp \
292
  chainparamsbase.cpp \
293
  clientversion.cpp \
294
  compat/glibc_sanity.cpp \
295
  compat/glibcxx_sanity.cpp \
296
  compat/strnlen.cpp \
297
  options.cpp \
298
  random.cpp \
299
  rpcprotocol.cpp \
300
  support/cleanse.cpp \
301
  sync.cpp \
302
  uint256.cpp \
303
  util.cpp \
304
  utilmoneystr.cpp \
305
  utilstrencodings.cpp \
306
  utiltime.cpp \
307
  $(BITCOIN_CORE_H)
308
309
if GLIBC_BACK_COMPAT
310
libbitcoin_util_a_SOURCES += compat/glibc_compat.cpp
311
endif
312
313
# cli: shared between bitcoin-cli and bitcoin-qt
314
libbitcoin_cli_a_CPPFLAGS = $(BITCOIN_INCLUDES)
315
libbitcoin_cli_a_SOURCES = \
316
  rpcclient.cpp \
317
  $(BITCOIN_CORE_H)
318
319
nodist_libbitcoin_util_a_SOURCES = $(srcdir)/obj/build.h
320
#
321
322
# bitcoind binary #
323
bitcoind_SOURCES = bitcoind.cpp
324
bitcoind_CPPFLAGS = $(BITCOIN_INCLUDES)
325
bitcoind_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
326
327
if TARGET_WINDOWS
328
bitcoind_SOURCES += bitcoind-res.rc
329
endif
330
331
bitcoind_LDADD = \
332
  $(LIBBITCOIN_SERVER) \
333
  $(LIBBITCOIN_COMMON) \
334
  $(LIBBITCOIN_UNIVALUE) \
335
  $(LIBBITCOIN_UTIL) \
336
  $(LIBBITCOIN_CRYPTO) \
337
  $(LIBLEVELDB) \
338
  $(LIBMEMENV) \
339
  $(LIBSECP256K1)
340
341
if ENABLE_WALLET
342
bitcoind_LDADD += libbitcoin_wallet.a
343
endif
344
345
bitcoind_LDADD += $(BOOST_LIBS) $(BDB_LIBS) $(SSL_LIBS) $(CRYPTO_LIBS) $(MINIUPNPC_LIBS) $(CURL_LIBS)
346
#
347
348
# bitcoin-cli binary #
349
bitcoin_cli_SOURCES = bitcoin-cli.cpp
350
bitcoin_cli_CPPFLAGS = $(BITCOIN_INCLUDES)
351
bitcoin_cli_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
352
353
if TARGET_WINDOWS
354
bitcoin_cli_SOURCES += bitcoin-cli-res.rc
355
endif
356
357
bitcoin_cli_LDADD = \
358
  $(LIBBITCOIN_CLI) \
359
  $(LIBBITCOIN_UTIL) \
360
  $(LIBSECP256K1)
361
362
bitcoin_cli_LDADD += $(BOOST_LIBS) $(SSL_LIBS) $(CRYPTO_LIBS)
363
#
364
365
# bitcoin-tx binary #
366
bitcoin_tx_SOURCES = bitcoin-tx.cpp
367
bitcoin_tx_CPPFLAGS = $(BITCOIN_INCLUDES)
368
bitcoin_tx_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
369
370
if TARGET_WINDOWS
371
bitcoin_tx_SOURCES += bitcoin-tx-res.rc
372
endif
373
374
bitcoin_tx_LDADD = \
375
  $(LIBBITCOIN_UNIVALUE) \
376
  $(LIBBITCOIN_COMMON) \
377
  $(LIBBITCOIN_UTIL) \
378
  $(LIBBITCOIN_CRYPTO) \
379
  $(LIBSECP256K1)
380
381
bitcoin_tx_LDADD += $(BOOST_LIBS) $(CRYPTO_LIBS)
382
#
383
384
# bitcoinconsensus library #
385
if BUILD_BITCOIN_LIBS
386
include_HEADERS = script/bitcoinconsensus.h
387
libbitcoinconsensus_la_SOURCES = \
388
  crypto/hmac_sha512.cpp \
389
  crypto/ripemd160.cpp \
390
  crypto/sha1.cpp \
391
  crypto/sha256.cpp \
392
  crypto/sha512.cpp \
393
  hash.cpp \
394
  primitives/transaction.cpp \
395
  pubkey.cpp \
396
  script/bitcoinconsensus.cpp \
397
  script/interpreter.cpp \
398
  script/script.cpp \
399
  uint256.cpp \
400
  utilstrencodings.cpp
401
402
if GLIBC_BACK_COMPAT
403
  libbitcoinconsensus_la_SOURCES += compat/glibc_compat.cpp
404
endif
405
406
libbitcoinconsensus_la_LDFLAGS = $(AM_LDFLAGS) -no-undefined $(RELDFLAGS)
407
libbitcoinconsensus_la_LIBADD = $(LIBSECP256K1)
408
libbitcoinconsensus_la_CPPFLAGS = $(AM_CPPFLAGS) -I$(builddir)/obj -I$(srcdir)/secp256k1/include -DBUILD_BITCOIN_INTERNAL
409
libbitcoinconsensus_la_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
410
411
endif
412
#
413
414
CLEANFILES = leveldb/libleveldb.a leveldb/libmemenv.a *.gcda *.gcno
415
416
DISTCLEANFILES = obj/build.h
417
418
EXTRA_DIST = leveldb
419
420
clean-local:
421
	-$(MAKE) -C leveldb clean
422
	-$(MAKE) -C secp256k1 clean
423
	rm -f leveldb/*/*.gcno leveldb/helpers/memenv/*.gcno
424
	-rm -f config.h
425
426
.rc.o:
427
	@test -f $(WINDRES)
428
	$(AM_V_GEN) $(WINDRES) -DWINDRES_PREPROC -i $< -o $@
429
430
.mm.o:
431
	$(AM_V_CXX) $(OBJCXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
432
	  $(CPPFLAGS) $(AM_CXXFLAGS) $(QT_INCLUDES) $(CXXFLAGS)  -c -o $@ $<
433
434
%.pb.cc %.pb.h: %.proto
435
	@test -f $(PROTOC)
436
	$(AM_V_GEN) $(PROTOC) --cpp_out=$(@D) --proto_path=$(abspath $(<D) $<)
437
438
if ENABLE_TESTS
439
include Makefile.test.include
440
endif
441
442
if ENABLE_QT
443
include Makefile.qt.include
444
endif
445
446
if ENABLE_QT_TESTS
447
include Makefile.qttest.include
448
endif
(-)/root/bitcoinxt-0.11E/src/Makefile.test.include (+2 lines)
Lines 121-130 Link Here
121
bitcoin_test_clean : FORCE
121
bitcoin_test_clean : FORCE
122
	rm -f $(CLEAN_BITCOIN_TEST) $(test_test_bitcoin_OBJECTS) $(TEST_BINARY)
122
	rm -f $(CLEAN_BITCOIN_TEST) $(test_test_bitcoin_OBJECTS) $(TEST_BINARY)
123
123
124
if EMBEDDED_LIBSECP256K1
124
check-local:
125
check-local:
125
	@echo "Running test/bitcoin-util-test.py..."
126
	@echo "Running test/bitcoin-util-test.py..."
126
	$(AM_V_at)srcdir=$(srcdir) PYTHONPATH=$(builddir)/test $(srcdir)/test/bitcoin-util-test.py
127
	$(AM_V_at)srcdir=$(srcdir) PYTHONPATH=$(builddir)/test $(srcdir)/test/bitcoin-util-test.py
127
	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C secp256k1 check
128
	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C secp256k1 check
129
endif
128
130
129
%.json.h: %.json
131
%.json.h: %.json
130
	@$(MKDIR_P) $(@D)
132
	@$(MKDIR_P) $(@D)
(-)/root/bitcoinxt-0.11E/src/Makefile.test.include.orig (+143 lines)
Line 0 Link Here
1
TESTS += test/test_bitcoin
2
bin_PROGRAMS += test/test_bitcoin
3
TEST_SRCDIR = test
4
TEST_BINARY=test/test_bitcoin$(EXEEXT)
5
6
7
EXTRA_DIST += \
8
	test/bctest.py \
9
	test/bitcoin-util-test.py \
10
	test/data/bitcoin-util-test.json \
11
	test/data/blanktx.hex \
12
	test/data/tt-delin1-out.hex \
13
	test/data/tt-delout1-out.hex \
14
	test/data/tt-locktime317000-out.hex \
15
	test/data/tx394b54bb.hex \
16
	test/data/txcreate1.hex \
17
	test/data/txcreate2.hex \
18
	test/data/txcreatesign.hex
19
20
JSON_TEST_FILES = \
21
  test/data/script_valid.json \
22
  test/data/base58_keys_valid.json \
23
  test/data/base58_encode_decode.json \
24
  test/data/base58_keys_invalid.json \
25
  test/data/script_invalid.json \
26
  test/data/tx_invalid.json \
27
  test/data/tx_valid.json \
28
  test/data/sighash.json
29
30
RAW_TEST_FILES = test/data/alertTests.raw
31
32
GENERATED_TEST_FILES = $(JSON_TEST_FILES:.json=.json.h) $(RAW_TEST_FILES:.raw=.raw.h)
33
34
BITCOIN_TESTS =\
35
  test/arith_uint256_tests.cpp \
36
  test/bignum.h \
37
  test/alert_tests.cpp \
38
  test/allocator_tests.cpp \
39
  test/base32_tests.cpp \
40
  test/base58_tests.cpp \
41
  test/base64_tests.cpp \
42
  test/bip32_tests.cpp \
43
  test/block_size_tests.cpp \
44
  test/bloom_tests.cpp \
45
  test/checkblock_tests.cpp \
46
  test/Checkpoints_tests.cpp \
47
  test/clientversion_tests.cpp \
48
  test/coins_tests.cpp \
49
  test/compress_tests.cpp \
50
  test/crypto_tests.cpp \
51
  test/curl_tests.cpp \
52
  test/DoS_tests.cpp \
53
  test/getarg_tests.cpp \
54
  test/hash_tests.cpp \
55
  test/ipgroups_tests.cpp \
56
  test/key_tests.cpp \
57
  test/main_tests.cpp \
58
  test/mempool_tests.cpp \
59
  test/miner_tests.cpp \
60
  test/multisig_tests.cpp \
61
  test/netbase_tests.cpp \
62
  test/p2p_protocol_tests.cpp \
63
  test/pmt_tests.cpp \
64
  test/policyestimator_tests.cpp \
65
  test/pow_tests.cpp \
66
  test/processmessage_tests.cpp \
67
  test/ReceiveMsgBytes_tests.cpp \
68
  test/rpc_tests.cpp \
69
  test/sanity_tests.cpp \
70
  test/scheduler_tests.cpp \
71
  test/script_P2SH_tests.cpp \
72
  test/script_tests.cpp \
73
  test/scriptnum_tests.cpp \
74
  test/serialize_tests.cpp \
75
  test/sighash_tests.cpp \
76
  test/sigopcount_tests.cpp \
77
  test/skiplist_tests.cpp \
78
  test/test_bitcoin.cpp \
79
  test/test_bitcoin.h \
80
  test/thinblockbuilder_tests.cpp \
81
  test/thinblockconcluder_tests.cpp \
82
  test/thinblockutil.cpp \
83
  test/thinblockutil.h \
84
  test/timedata_tests.cpp \
85
  test/transaction_tests.cpp \
86
  test/uint256_tests.cpp \
87
  test/univalue_tests.cpp \
88
  test/util_tests.cpp
89
90
if ENABLE_WALLET
91
BITCOIN_TESTS += \
92
  test/accounting_tests.cpp \
93
  wallet/test/wallet_tests.cpp \
94
  test/rpc_wallet_tests.cpp
95
endif
96
97
test_test_bitcoin_SOURCES = $(BITCOIN_TESTS) $(JSON_TEST_FILES) $(RAW_TEST_FILES)
98
test_test_bitcoin_CPPFLAGS = $(BITCOIN_INCLUDES) -I$(builddir)/test/ $(TESTDEFS)
99
test_test_bitcoin_LDADD = $(LIBBITCOIN_SERVER) $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_UTIL) $(LIBBITCOIN_CRYPTO) $(LIBBITCOIN_UNIVALUE) $(LIBLEVELDB) $(LIBMEMENV) \
100
  $(BOOST_LIBS) $(BOOST_UNIT_TEST_FRAMEWORK_LIB) $(LIBSECP256K1)
101
if ENABLE_WALLET
102
test_test_bitcoin_LDADD += $(LIBBITCOIN_WALLET)
103
endif
104
105
test_test_bitcoin_LDADD += $(LIBBITCOIN_CONSENSUS) $(BDB_LIBS) $(SSL_LIBS) $(CRYPTO_LIBS) $(MINIUPNPC_LIBS) $(CURL_LIBS)
106
test_test_bitcoin_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) -static
107
108
nodist_test_test_bitcoin_SOURCES = $(GENERATED_TEST_FILES)
109
110
$(BITCOIN_TESTS): $(GENERATED_TEST_FILES)
111
112
CLEAN_BITCOIN_TEST = test/*.gcda test/*.gcno $(GENERATED_TEST_FILES)
113
114
CLEANFILES += $(CLEAN_BITCOIN_TEST)
115
116
bitcoin_test: $(TEST_BINARY)
117
118
bitcoin_test_check: $(TEST_BINARY) FORCE
119
	$(MAKE) check-TESTS TESTS=$^
120
121
bitcoin_test_clean : FORCE
122
	rm -f $(CLEAN_BITCOIN_TEST) $(test_test_bitcoin_OBJECTS) $(TEST_BINARY)
123
124
check-local:
125
	@echo "Running test/bitcoin-util-test.py..."
126
	$(AM_V_at)srcdir=$(srcdir) PYTHONPATH=$(builddir)/test $(srcdir)/test/bitcoin-util-test.py
127
	$(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C secp256k1 check
128
129
%.json.h: %.json
130
	@$(MKDIR_P) $(@D)
131
	@echo "namespace json_tests{" > $@
132
	@echo "static unsigned const char $(*F)[] = {" >> $@
133
	@$(HEXDUMP) -v -e '8/1 "0x%02x, "' -e '"\n"' $< | $(SED) -e 's/0x  ,//g' >> $@
134
	@echo "};};" >> $@
135
	@echo "Generated $@"
136
137
%.raw.h: %.raw
138
	@$(MKDIR_P) $(@D)
139
	@echo "namespace alert_tests{" > $@
140
	@echo "static unsigned const char $(*F)[] = {" >> $@
141
	@$(HEXDUMP) -v -e '8/1 "0x%02x, "' -e '"\n"' $< | $(SED) -e 's/0x  ,//g' >> $@
142
	@echo "};};" >> $@
143
	@echo "Generated $@"

Return to bug 574672