]> Git Repo - VerusCoin.git/blame - configure.ac
Merge pull request #3026 from sipa/checkunspend
[VerusCoin.git] / configure.ac
CommitLineData
35b8af92
CF
1dnl require autoconf 2.60 (AS_ECHO/AS_ECHO_N)
2AC_PREREQ([2.60])
3define(_CLIENT_VERSION_MAJOR, 0)
4define(_CLIENT_VERSION_MINOR, 8)
5define(_CLIENT_VERSION_REVISION, 99)
6define(_CLIENT_VERSION_BUILD, 0)
7define(_CLIENT_VERSION_IS_RELEASE, false)
8define(_COPYRIGHT_YEAR, 2013)
9AC_INIT([Bitcoin],[_CLIENT_VERSION_MAJOR._CLIENT_VERSION_MINOR._CLIENT_VERSION_REVISION],[[email protected]],[bitcoin])
10AC_CONFIG_AUX_DIR([src/build-aux])
11AC_CONFIG_MACRO_DIR([src/m4])
12AC_CANONICAL_HOST
13AH_TOP([#ifndef BITCOIN_CONFIG_H])
14AH_TOP([#define BITCOIN_CONFIG_H])
15AH_BOTTOM([#endif //BITCOIN_CONFIG_H])
16
17# This m4 will only be used if a system copy cannot be found. This is helpful
18# on systems where autotools are installed but the pkg-config macros are not in
19# a default location. It is currently used for building on OSX where autotools
20# are preinstalled but pkg-config comes from macports or homebrew. It should
21# probably be removed when building on <= 10.6 is no longer supported.
22m4_include([pkg.m4])
23
35b8af92
CF
24dnl faketime breaks configure and is only needed for make. Disable it here.
25unset FAKETIME
26
27dnl ==============================================================
28dnl Setup for automake
29dnl ==============================================================
30
31AM_INIT_AUTOMAKE([no-define subdir-objects foreign])
32
33dnl faketime messes with timestamps and causes configure to be re-run.
34dnl --disable-maintainer-mode can be used to bypass this.
35AM_MAINTAINER_MODE([enable])
36
37dnl make the compilation flags quiet unless V=1 is used
38m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
39
40AC_ARG_WITH([miniupnpc],
41 [AS_HELP_STRING([--with-miniupnpc],
42 [enable UPNP (default is yes if libminiupnpc is found)])],
43 [use_upnp=$withval],
44 [use_upnp=auto])
45
46AC_ARG_ENABLE([upnp-default],
47 [AS_HELP_STRING([--enable-upnp-default],
48 [if UPNP is enabled, turn it on at startup (default is no)])],
49 [use_upnp_default=$enableval],
50 [use_upnp_default=no])
51
52dnl enable ipv6 support
53AC_ARG_ENABLE([ipv6],
54 [AS_HELP_STRING([--enable-ipv6],
55 [enable ipv6 (default is yes)])],
56 [use_ipv6=$enableval],
57 [use_ipv6=yes])
58
59dnl enable qt support
60AC_ARG_WITH([qt],
61 [AS_HELP_STRING([--with-qt],
62 [enable qt (default is yes)])],
63 [use_qt=$withval],
64 [use_qt=yes])
65
35b8af92
CF
66AC_ARG_ENABLE(tests,
67 AS_HELP_STRING([--enable-tests],[compile tests (default is yes)]),
68 [use_tests=$enableval],
69 [use_tests=yes])
70
71AC_ARG_WITH([comparison-tool],
72 AS_HELP_STRING([with-comparison-tool],[path to java comparison tool (requires --enable-tests)]),
73 [use_comparison_tool=$withval],
74 [use_comparison_tool=no])
75
76AC_ARG_WITH([qrencode],
77 [AS_HELP_STRING([--with-qrencode],
78 [enable QR code support (default is yes if qt is enabled and libqrencode is found)])],
79 [use_qr=$withval],
80 [use_qr=auto])
81
82AC_ARG_WITH([qtdbus],
83 [AS_HELP_STRING([--with-qtdbus],
84 [enable DBus support (default is yes if qt is enabled and QtDBus is found)])],
85 [use_dbus=$withval],
86 [use_dbus=auto])
87
88AC_ARG_ENABLE([hardening],
89 [AS_HELP_STRING([--enable-hardening],
90 [attempt to harden the resulting executables (default is yes)])],
91 [use_hardening=$enableval],
92 [use_hardening=yes])
93
94AC_ARG_ENABLE([ccache],
95 [AS_HELP_STRING([--enable-ccache],
96 [enable building with ccache (default is yes if ccache is found)])],
97 [use_ccache=$enableval],
98 [use_ccache=auto])
99
100AC_ARG_ENABLE([lcov],
101 [AS_HELP_STRING([--enable-lcov],
102 [enable lcov testing (default is no)])],
103 [use_lcov=yes],
104 [use_lcov=no])
105
106AC_ARG_WITH([qt-incdir],[AS_HELP_STRING([--with-qt-incdir=INC_DIR],[specify qt include path (overridden by pkgconfig)])], [qt_include_path=$withval], [])
107AC_ARG_WITH([qt-libdir],[AS_HELP_STRING([--with-qt-libdir=LIB_DIR],[specify qt lib path (overridden by pkgconfig)])], [qt_lib_path=$withval], [])
108AC_ARG_WITH([qt-bindir],[AS_HELP_STRING([--with-qt-bindir=BIN_DIR],[specify qt bin path])], [qt_bin_path=$withval], [])
109AC_ARG_WITH([qt-plugindir],[AS_HELP_STRING([--with-qt-plugindir=PLUGIN_DIR],[specify qt plugin path (overridden by pkgconfig)])], [qt_plugin_path=$withval], [])
110AC_ARG_WITH([protoc-bindir],[AS_HELP_STRING([--with-protoc-bindir=BIN_DIR],[specify protoc bin path])], [protoc_bin_path=$withval], [])
111
112
113AC_CONFIG_SRCDIR([src])
114AC_CONFIG_HEADERS([src/bitcoin-config.h])
115
116dnl Checks for programs.
117AC_PROG_CXX
118AC_PROG_CC
119AC_PROG_CPP
941dba17 120AC_PROG_CXXCPP
35b8af92
CF
121AC_PROG_INSTALL
122AC_PROG_OBJC
123m4_ifdef([AC_PROG_OBJCXX],[AC_PROG_OBJCXX])
124AC_PROG_MKDIR_P
125AC_PROG_SED
126AC_PATH_TOOL(AR, ar)
127AC_PATH_TOOL(RANLIB, ranlib)
128AC_PATH_TOOL(WINDRES, windres)
129AC_PATH_TOOL(STRIP, strip)
130AC_PATH_TOOL(GCOV, gcov)
131AC_PATH_PROG(LCOV, lcov)
132AC_PATH_PROG(JAVA, java)
133AC_PATH_PROG(GENHTML, genhtml)
134AC_PATH_PROG([GIT], [git])
9a09c009
LD
135AC_PATH_PROGS([MOC], [moc-qt4 moc4 moc],, $qt_bin_path:$PATH)
136AC_PATH_PROGS([UIC], [uic-qt4 uic4 uic],, $qt_bin_path:$PATH)
137AC_PATH_PROGS([RCC], [rcc-qt4 rcc4 rcc],, $qt_bin_path:$PATH)
138AC_PATH_PROGS([LRELEASE], [lrelease-qt4 lrelease4 lrelease],, $qt_bin_path:$PATH)
035ddf6f 139AC_PATH_PROGS([LUPDATE], [lupdate-qt4 lupdate4 lupdate],, $qt_bin_path:$PATH)
35b8af92
CF
140AC_PATH_PROG([PROTOC], [protoc],, $protoc_bin_path:$PATH)
141AC_PATH_PROG(CCACHE,ccache)
035ddf6f 142AC_PATH_PROG(XGETTEXT,xgettext)
152e51c7 143AC_PATH_PROG(HEXDUMP,hexdump)
35b8af92
CF
144PKG_PROG_PKG_CONFIG
145
146## TODO: Remove these hard-coded paths and flags. They are here for the sake of
147## compatibility with the legacy buildsystem.
148##
149CXXFLAGS="$CXXFLAGS -Wall -Wextra -Wformat -Wformat-security -Wno-unused-parameter"
150CPPFLAGS="$CPPFLAGS -DBOOST_SPIRIT_THREADSAFE -DHAVE_BUILD_INFO"
35b8af92
CF
151
152AC_LANG_PUSH([C++])
153
154use_pkgconfig=yes
155case $host in
156 *mingw*)
157
158 #pkgconfig does more harm than good with mingw
159 use_pkgconfig=no
160
161 TARGET_OS=windows
162 AC_CHECK_LIB([mingwthrd], [main],, AC_MSG_ERROR(lib missing))
163 AC_CHECK_LIB([kernel32], [main],, AC_MSG_ERROR(lib missing))
164 AC_CHECK_LIB([user32], [main],, AC_MSG_ERROR(lib missing))
165 AC_CHECK_LIB([gdi32], [main],, AC_MSG_ERROR(lib missing))
166 AC_CHECK_LIB([comdlg32], [main],, AC_MSG_ERROR(lib missing))
167 AC_CHECK_LIB([winspool], [main],, AC_MSG_ERROR(lib missing))
168 AC_CHECK_LIB([winmm], [main],, AC_MSG_ERROR(lib missing))
169 AC_CHECK_LIB([shell32], [main],, AC_MSG_ERROR(lib missing))
170 AC_CHECK_LIB([comctl32], [main],, AC_MSG_ERROR(lib missing))
171 AC_CHECK_LIB([ole32], [main],, AC_MSG_ERROR(lib missing))
172 AC_CHECK_LIB([oleaut32], [main],, AC_MSG_ERROR(lib missing))
173 AC_CHECK_LIB([uuid], [main],, AC_MSG_ERROR(lib missing))
174 AC_CHECK_LIB([rpcrt4], [main],, AC_MSG_ERROR(lib missing))
175 AC_CHECK_LIB([advapi32], [main],, AC_MSG_ERROR(lib missing))
176 AC_CHECK_LIB([ws2_32], [main],, AC_MSG_ERROR(lib missing))
177 AC_CHECK_LIB([mswsock], [main],, AC_MSG_ERROR(lib missing))
178 AC_CHECK_LIB([shlwapi], [main],, AC_MSG_ERROR(lib missing))
179 AC_CHECK_LIB([iphlpapi], [main],, AC_MSG_ERROR(lib missing))
180
181 AC_PATH_PROG([MAKENSIS], [makensis], none)
182 if test x$MAKENSIS = xnone; then
183 AC_MSG_WARN("makensis not found. Cannot create installer.")
184 fi
185
186 CPPFLAGS="$CPPFLAGS -D_MT -DWIN32 -D_WINDOWS -DBOOST_THREAD_USE_LIB"
187 LEVELDB_TARGET_FLAGS="TARGET_OS=OS_WINDOWS_CROSSCOMPILE"
188 CXXFLAGS="$CXXFLAGS -w"
189 ;;
190 *darwin*)
191 TARGET_OS=darwin
192 LEVELDB_TARGET_FLAGS="TARGET_OS=Darwin"
193 if test x$cross_compiling != xyes; then
194 AC_CHECK_PROG([PORT],port, port)
195 if test x$PORT = xport; then
196 dnl add default macports paths
197 CPPFLAGS="$CPPFLAGS -I/opt/local/include -I/opt/local/include/db48"
198 LIBS="$LIBS -L/opt/local/lib -L/opt/local/lib/db48"
199 fi
200
201 AC_CHECK_PROG([BREW],brew, brew)
202 if test x$BREW = xbrew; then
203 dnl add default homebrew paths
204 openssl_prefix=`$BREW --prefix openssl`
205 bdb_prefix=`$BREW --prefix berkeley-db4`
206 export PKG_CONFIG_PATH="$openssl_prefix/lib/pkgconfig:$PKG_CONFIG_PATH"
207 CPPFLAGS="$CPPFLAGS -I$bdb_prefix/include"
208 LIBS="$LIBS -L/$bdb_prefix/lib"
209 fi
210 fi
211
212 if test x$use_qt = xyes; then
213 MOC_DEFS="-DQ_OS_MAC"
214 base_frameworks="-framework Foundation -framework ApplicationServices -framework AppKit"
215 AX_CHECK_LINK_FLAG([[$base_frameworks]],[LIBS="$LIBS $base_frameworks"],[AC_MSG_ERROR(could not find base frameworks)])
216 fi
217
35b8af92
CF
218 CPPFLAGS="$CPPFLAGS -DMAC_OSX"
219 TESTDEFS="-DBOOST_TEST_DYN_LINK"
220 ;;
221 *)
222 TESTDEFS="-DBOOST_TEST_DYN_LINK"
223 ;;
224esac
225
35b8af92
CF
226if test x$use_comparison_tool != xno; then
227 AC_SUBST(JAVA_COMPARISON_TOOL, $use_comparison_tool)
228fi
229
230if test x$use_lcov == xyes; then
231 if test x$LCOV == x; then
232 AC_MSG_ERROR("lcov testing requested but lcov not found")
233 fi
234 if test x$GCOV == x; then
235 AC_MSG_ERROR("lcov testing requested but gcov not found")
236 fi
237 if test x$JAVA == x; then
238 AC_MSG_ERROR("lcov testing requested but java not found")
239 fi
240 if test x$GENHTML == x; then
241 AC_MSG_ERROR("lcov testing requested but genhtml not found")
242 fi
243 if test x$use_comparison_tool == x; then
244 AC_MSG_ERROR("lcov testing requested but comparison tool was not specified")
245 fi
246 LCOV="$LCOV --gcov-tool=$GCOV"
247 AX_CHECK_COMPILE_FLAG([--coverage],[CXXFLAGS="$CXXFLAGS --coverage"],
248 [AC_MSG_ERROR("lcov testing requested but --coverage flag does not work")])
249fi
250
251dnl Require little endian
252AC_C_BIGENDIAN([AC_MSG_ERROR("Big Endian not supported")])
253
254dnl Check for pthread compile/link requirements
255AX_PTHREAD
256INCLUDES="$INCLUDES $PTHREAD_CFLAGS"
257
258# The following macro will add the necessary defines to bitcoin-config.h, but
259# they also need to be passed down to any subprojects. Pull the results out of
260# the cache and add them to CPPFLAGS.
261AC_SYS_LARGEFILE
262
263if test x$ac_cv_sys_file_offset_bits != x &&
264 test x$ac_cv_sys_file_offset_bits != xno &&
265 test x$ac_cv_sys_file_offset_bits != xunknown; then
266 CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits"
267fi
268
269if test x$ac_cv_sys_large_files != x &&
270 test x$ac_cv_sys_large_files != xno &&
271 test x$ac_cv_sys_large_files != xunknown; then
272 CPPFLAGS="$CPPFLAGS -D_LARGE_FILES=$ac_cv_sys_large_files"
273fi
274
275AX_CHECK_LINK_FLAG([[-Wl,--large-address-aware]], [LDFLAGS="$LDFLAGS -Wl,--large-address-aware"])
276
277if test x$use_hardening != xno; then
278 AX_CHECK_COMPILE_FLAG([-Wstack-protector],[HARDENED_CXXFLAGS="$HARDENED_CXXFLAGS -Wstack-protector"])
279 AX_CHECK_COMPILE_FLAG([-fPIE],[HARDENED_CXXFLAGS="$HARDENED_CXXFLAGS -fPIE"])
280
281 AX_CHECK_PREPROC_FLAG([-D_FORTIFY_SOURCE=2],[HARDENED_CPPFLAGS="$HARDENED_CPPFLAGS -D_FORTIFY_SOURCE=2"])
282
283 AX_CHECK_LINK_FLAG([[-Wl,--dynamicbase]], [HARDENED_LDFLAGS="$HARDENED_LDFLAGS -Wl,--dynamicbase"])
284 AX_CHECK_LINK_FLAG([[-Wl,--nxcompat]], [HARDENED_LDFLAGS="$HARDENED_LDFLAGS -Wl,--nxcompat"])
285 AX_CHECK_LINK_FLAG([[-Wl,-z,relro]], [LDFLAGS="-Wl,-z,relro"])
286 AX_CHECK_LINK_FLAG([[-Wl,-z,now]], [LDFLAGS="-Wl,-z,now"])
287
288 if test x$TARGET_OS != xwindows; then
289 # -fstack-protector-all can produce broken binaries with mingw
290 AX_CHECK_COMPILE_FLAG([-fno-stack-protector],[HARDENED_CXXFLAGS="$HARDENED_CXXFLAGS -fno-stack-protector"])
291 AX_CHECK_COMPILE_FLAG([-fstack-protector-all],[HARDENED_CXXFLAGS="$HARDENED_CXXFLAGS -fstack-protector-all"])
292
293 # -pie will link successfully with mingw, but it's unsupported and leads to undeterministic binaries
294 AX_CHECK_LINK_FLAG([[-pie]], [HARDENED_LDFLAGS="$HARDENED_LDFLAGS -pie"])
295 fi
296
297 CXXFLAGS="$CXXFLAGS $HARDENED_CXXFLAGS"
298 CPPFLAGS="$CPPFLAGS $HARDENED_CPPFLAGS"
299 LDFLAGS="$LDFLAGS $HARDENED_LDFLAGS"
300 OBJCXXFLAGS="$CXXFLAGS"
301fi
302
303dnl this flag screws up non-darwin gcc even when the check fails. special-case it.
304if test x$TARGET_OS = xdarwin; then
305 AX_CHECK_LINK_FLAG([[-Wl,-dead_strip]], [LDFLAGS="$LDFLAGS -Wl,-dead_strip"])
306fi
307
308AC_CHECK_HEADERS([stdio.h stdlib.h unistd.h strings.h sys/types.h sys/stat.h])
309
310dnl Check for MSG_NOSIGNAL
311AC_MSG_CHECKING(for MSG_NOSIGNAL)
312AC_TRY_COMPILE([#include <sys/socket.h>],
313 [ int f = MSG_NOSIGNAL; ],
314 [ AC_MSG_RESULT(yes); AC_DEFINE(HAVE_MSG_NOSIGNAL, 1,[Define this symbol if you have MSG_NOSIGNAL]) ],
315 [ AC_MSG_RESULT(no)]
316)
317
318dnl Check for libdb_cxx
941dba17 319BITCOIN_FIND_BDB48
35b8af92
CF
320
321dnl Check for libminiupnpc (optional)
322if test x$use_upnp != xno; then
323 AC_CHECK_LIB([miniupnpc], [main],, [have_miniupnpc=no])
324fi
325
326dnl Check for boost libs
327AX_BOOST_BASE
328AX_BOOST_SYSTEM
329AX_BOOST_FILESYSTEM
330AX_BOOST_PROGRAM_OPTIONS
331AX_BOOST_THREAD
332AX_BOOST_CHRONO
333
334if test x$use_tests = xyes; then
152e51c7
CF
335
336 if test x$HEXDUMP = x; then
337 AC_MSG_ERROR(hexdump is required for tests)
338 fi
339
340
35b8af92
CF
341 AX_BOOST_UNIT_TEST_FRAMEWORK
342fi
343
344BOOST_LIBS="$BOOST_LDFLAGS $BOOST_SYSTEM_LIB $BOOST_FILESYSTEM_LIB $BOOST_PROGRAM_OPTIONS_LIB $BOOST_THREAD_LIB"
345BOOST_INCLUDES="$BOOST_CPPFLAGS"
346
347dnl Boost >= 1.50 uses sleep_for rather than the now-deprecated sleep, however
348dnl it was broken from 1.50 to 1.52 when backed by nanosleep. Use sleep_for if
349dnl a working version is available, else fall back to sleep. sleep was removed
350dnl after 1.56.
351dnl If neither is available, abort.
352dnl If sleep_for is used, boost_chrono becomes a requirement.
353if test x$ax_cv_boost_chrono = xyes; then
354TEMP_LIBS="$LIBS"
355LIBS="$LIBS $BOOST_LIBS $BOOST_CHRONO_LIB"
356AC_TRY_LINK([
357 #include <boost/thread/thread.hpp>
358 #include <boost/version.hpp>
359 ],[
360 #if BOOST_VERSION >= 105000 && (!defined(BOOST_HAS_NANOSLEEP) || BOOST_VERSION >= 105200)
361 boost::this_thread::sleep_for(boost::chrono::milliseconds(0));
362 #else
363 choke me
364 #endif
365 ],
366 [boost_sleep=yes; BOOST_LIBS="$BOOST_LIBS $BOOST_CHRONO_LIB";
367 AC_DEFINE(HAVE_WORKING_BOOST_SLEEP_FOR, 1, [Define this symbol if boost sleep_for works])],
368 [boost_sleep=no])
369LIBS="$TEMP_LIBS"
370fi
371
372if test x$boost_sleep != xyes; then
373TEMP_LIBS="$LIBS"
374LIBS="$LIBS $BOOST_LIBS"
375AC_TRY_LINK([
376 #include <boost/version.hpp>
377 #include <boost/thread.hpp>
378 #include <boost/date_time/posix_time/posix_time_types.hpp>
379 ],[
380 #if BOOST_VERSION <= 105600
381 boost::this_thread::sleep(boost::posix_time::milliseconds(0));
382 #else
383 choke me
384 #endif
385 ],
386 [boost_sleep=yes; AC_DEFINE(HAVE_WORKING_BOOST_SLEEP, 1, [Define this symbol if boost sleep works])],
387 [boost_sleep=no])
388LIBS="$TEMP_LIBS"
389fi
390
391if test x$boost_sleep != xyes; then
392 AC_MSG_ERROR(No working boost sleep implementation found)
393fi
394
395if test x$use_pkgconfig = xyes; then
396
397 if test x$PKG_CONFIG == x; then
12564aa1 398 AC_MSG_ERROR(pkg-config not found.)
35b8af92
CF
399 fi
400
401 : #NOP
402 m4_ifdef(
403 [PKG_CHECK_MODULES],
404 [
405 PKG_CHECK_MODULES([SSL], [libssl], [INCLUDES="$INCLUDES $SSL_CFLAGS"; LIBS="$LIBS $SSL_LIBS"], [AC_MSG_ERROR(openssl not found.)])
406 PKG_CHECK_MODULES([CRYPTO], [libcrypto], [INCLUDES="$INCLUDES $CRYPTO_CFLAGS"; LIBS="$LIBS $CRYPTO_LIBS"], [AC_MSG_ERROR(libcrypto not found.)])
407
408 if test x$use_qt = xyes; then
409 PKG_CHECK_MODULES([QT], [QtCore QtGui QtNetwork], [QT_INCLUDES="$QT_CFLAGS"; have_qt=yes], [have_qt=no])
410 if test x$use_tests = xyes; then
411 PKG_CHECK_MODULES([QT_TEST], [QtTest], [QT_TEST_INCLUDES="$QT_TEST_CFLAGS"; have_qt_test=yes], [have_qt_test=no])
412 fi
413 if test x$use_dbus != xno; then
414 PKG_CHECK_MODULES([QT_DBUS], [QtDBus], [QT_DBUS_INCLUDES="$QT_DBUS_CFLAGS"; have_qt_dbus=yes], [have_qt_dbus=no])
415 fi
416 if test x$use_qr != xno; then
417 PKG_CHECK_MODULES([QR], [libqrencode], [have_qrencode=yes], [have_qrencode=no])
418 fi
419 PKG_CHECK_MODULES([PROTOBUF], [protobuf], [have_protobuf=yes], [AC_MSG_ERROR(libprotobuf not found.)])
420 fi
421 ]
422 )
423else
424 AC_CHECK_HEADER([openssl/crypto.h],,AC_MSG_ERROR(libcrypto headers missing))
425 AC_CHECK_LIB([crypto], [main],, AC_MSG_ERROR(libcrypto missing))
426
427 AC_CHECK_HEADER([openssl/ssl.h],, AC_MSG_ERROR(libssl headers missing),)
428 AC_CHECK_LIB([ssl], [main],, AC_MSG_ERROR(libssl missing))
429
430 if test x$use_qt = xyes; then
431 TEMP_LIBS="$LIBS"
432 LIBS=
433 if test x$qt_lib_path != x; then
434 QT_LIBS="$QT_LIBS -L$qt_lib_path"
435 LIBS="$QT_LIBS"
436 fi
437 if test x$qt_plugin_path != x; then
438 QT_LIBS="$QT_LIBS -L$qt_plugin_path/codecs"
439 LIBS="$QT_LIBS"
440 fi
441
442 if test x$TARGET_OS == xwindows; then
443 AC_CHECK_LIB([imm32], [main],, AC_MSG_ERROR(libimm32 not found. Install it or use --without-qt.))
444 fi
445
446 #TODO: These are only needed when they're linked directly to parent libs. It really has nothing to do with windows.
447 #Instead, check for missing functions in parent libs and assume static if they're absent.
448 if test x$TARGET_OS == xwindows; then
449 AC_CHECK_LIB([qcncodecs], [main],, AC_MSG_ERROR(libqcncodecs not found. Install it or use --without-qt.))
450 AC_CHECK_LIB([qjpcodecs], [main],, AC_MSG_ERROR(libqjpcodecs not found. Install it or use --without-qt.))
451 AC_CHECK_LIB([qkrcodecs], [main],, AC_MSG_ERROR(libqkrcodecs not found. Install it or use --without-qt.))
452 AC_CHECK_LIB([qtwcodecs], [main],, AC_MSG_ERROR(libqtwcodecs not found. Install it or use --without-qt.))
453 fi
454
455 AC_CHECK_LIB([QtCore], [main],, AC_MSG_ERROR(libQtCore not found. Install it or use --without-qt.))
456 AC_CHECK_LIB([QtGui], [main],, AC_MSG_ERROR(libQtGui not found. Install it or use --without-qt.))
457 AC_CHECK_LIB([QtNetwork], [main],, AC_MSG_ERROR(libQtNetwork not found. Install it or use --without-qt.))
458 AC_CHECK_LIB([protobuf], [main],, AC_MSG_ERROR(libprotobuf not found. Install it or use --without-qt.))
459 QT_LIBS="$LIBS"
460 LIBS="$TEMP_LIBS"
461
462 TEMP_CPPFLAGS="$CPPFLAGS"
463 if test x$qt_include_path != x; then
464 QT_INCLUDES="-I$qt_include_path -I$qt_include_path/QtCore -I$qt_include_path/QtGui -I$qt_include_path/QtNetwork -I$qt_include_path/QtTest -I$qt_include_path/QtDBus"
465 CPPFLAGS="$CPPFLAGS $QT_INCLUDES"
466 fi
467 AC_CHECK_HEADER([QtPlugin],, AC_MSG_ERROR(QtCore headers missing. Install them or use --without-qt.),)
468 AC_CHECK_HEADER([QApplication],, AC_MSG_ERROR(QtGUI headers missing. Install them or use --without-qt.),)
469 AC_CHECK_HEADER([QLocalSocket],, AC_MSG_ERROR(QtNetwork headers missing. Install them or use --without-qt.),)
470
471 if test x$use_tests = xyes; then
472 TEMP_LIBS="$LIBS"
473 LIBS=
474 if test x$qt_lib_path != x; then
475 LIBS="-L$qt_lib_path"
476 fi
477 AC_CHECK_LIB([QtTest], [main],, have_qt_test=no)
478 AC_CHECK_HEADER([QTest],, have_qt_test=no)
479 QT_TEST_LIBS="$LIBS"
480 LIBS="$TEMP_LIBS"
481 fi
482 if test x$use_dbus != xno; then
483 TEMP_LIBS="$LIBS"
484 LIBS=
485 if test x$qt_lib_path != x; then
486 LIBS="-L$qt_lib_path"
487 fi
488 AC_CHECK_LIB([QtDBus], [main],, have_qt_dbus=no)
489 AC_CHECK_HEADER([QtDBus],, have_qt_dbus=no)
490 QT_DBUS_LIBS="$LIBS"
491 LIBS="$TEMP_LIBS"
492 fi
493 CPPFLAGS="$TEMP_CPPFLAGS"
494 if test x$use_qr != xno; then
495 AC_CHECK_LIB([qrencode], [main],, [have_qrencode=no])
496 AC_CHECK_HEADER([qrencode.h],, have_qrencode=no)
497 fi
498 fi
499fi
500
501if test x$use_ipv6 = xyes; then
502 dnl Check for ipv6 build requirements
503 AC_MSG_CHECKING(for IPV6 build support)
504 AC_TRY_LINK([
505 #if defined(_WINDOWS)
506 #include <winsock2.h>
507 #else
508 #include <sys/types.h>
509 #include <sys/socket.h>
510 #include <netinet/in.h>
511 #endif
512 ],[
513 #if !defined(_WINDOWS)
514 struct in6_addr ipv6Addr;
515 struct sockaddr_in6 addr;
516 #endif
517 int temp = socket(AF_INET6, SOCK_STREAM, 0);],
518 [AC_MSG_RESULT(yes); have_ipv6=yes; AC_DEFINE(HAVE_IPV6, 1, [Define this symbol if you have ipv6 build support])],
519 [AC_MSG_RESULT(no)]; have_ipv6=no)
520fi
521AC_LANG_POP
522
523if test "x$use_ccache" != "xno"; then
524 AC_MSG_CHECKING(if ccache should be enabled)
525 if test x$CCACHE = x; then
526 if test "x$use_ccache" = "xyes"; then
527 AC_MSG_ERROR([ccache not found.]);
528 else
529 AC_MSG_NOTICE([ccache not found. Falling back to default CC])
530 use_ccache=no
531 fi
532 else
533 use_ccache=yes
534 CC="$ac_cv_path_CCACHE $CC"
535 CXX="$ac_cv_path_CCACHE $CXX"
536 fi
537 AC_MSG_RESULT($use_ccache)
538fi
539
540dnl enable ipv6 support
541AC_MSG_CHECKING([if ipv6 should be enabled])
542if test x$have_ipv6 = xno; then
543 if test x$use_ipv6 = xyes; then
544 AC_MSG_ERROR("ipv6 requested but cannot be built. use --disable-ipv6")
545 fi
546 AC_MSG_RESULT(no)
547else
548 if test x$use_ipv6 = xyes; then
549 AC_MSG_RESULT(yes)
550 AC_DEFINE([USE_IPV6],[1],[Define if ipv6 support should be compiled in])
551 else
552 AC_MSG_RESULT(no)
553 fi
554fi
555
556dnl enable upnp support
557AC_MSG_CHECKING([if upnp should be enabled])
558if test x$have_miniupnpc = xno; then
559 if test x$use_upnp = xyes; then
560 AC_MSG_ERROR("upnp requested but cannot be built. use --without-miniupnpc")
561 fi
562 AC_MSG_RESULT(no)
563else
564 if test x$use_upnp != xno; then
565 AC_MSG_RESULT(yes)
566 AC_MSG_CHECKING([if upnp should be on by default])
567 use_upnp=yes
568 upnp_setting=0
569 if test x$use_upnp_default != xno; then
570 use_upnp_default=yes
571 upnp_setting=1
572 fi
573 AC_MSG_RESULT($use_upnp_default)
574 AC_DEFINE_UNQUOTED([USE_UPNP],[$upnp_setting],[Define to 1 for upnp runtime support])
575 if test x$TARGET_OS = xwindows; then
576 CPPFLAGS="$CPPFLAGS -DSTATICLIB"
577 fi
578 else
579 AC_MSG_RESULT(no)
580 fi
581fi
582
583dnl enable qt support
584AC_MSG_CHECKING([if qt should be enabled])
585if test x$use_qt = xyes; then
586 if test x$have_qt = xno; then
587 AC_MSG_ERROR("qt support requested but qt could not be located. use --without-qt")
588 fi
589 if test x$MOC = x; then
590 AC_MSG_ERROR("qt support requested but moc was not found. use --without-qt")
591 fi
592 if test x$PROTOC = x; then
593 AC_MSG_ERROR("qt support requested but protoc was not found. use --without-qt")
594 fi
595 if test x$UIC = x; then
596 AC_MSG_ERROR("qt support requested but uic was not found. use --without-qt")
597 fi
598 if test x$RCC = x; then
599 AC_MSG_ERROR("qt support requested but rcc was not found. use --without-qt")
600 fi
601 if test x$LRELEASE = x; then
602 AC_MSG_ERROR("qt support requested but lrelease was not found. use --without-qt")
603 fi
604 if test x$use_tests = xyes; then
605 if test x$have_qt_test = xno; then
606 AC_MSG_ERROR("libQtTest not found. Use --disable-tests or --without-qt.")
607 fi
608 fi
609 if test x$have_qt_dbus = xno; then
610 use_dbus=no
611 if test x$use_dbus = xyes; then
612 AC_MSG_ERROR("libQtDBus not found. Use --without-qtdbus.")
613 fi
614 fi
035ddf6f
CF
615 if test x$XGETTEXT == x; then
616 AC_MSG_WARN("xgettext is required to update qt translations")
617 fi
618 if test x$LUPDATE == x; then
619 AC_MSG_WARN("lupdate is required to update qt translations")
620 fi
621
35b8af92
CF
622 BUILD_QT=qt
623else
624 use_qt=no
625fi
626
627AC_MSG_RESULT($use_qt)
628
629dnl these are only used when qt is enabled
630if test x$use_qt = xyes; then
631
632 dnl enable dbus support
633 AC_MSG_CHECKING([if dbus should be enabled])
634 if test x$use_dbus != xno; then
635 use_dbus=yes
636 AC_DEFINE([USE_DBUS],[1],[Define if dbus support should be compiled in])
637 else
638 use_dbus=no
639 fi
640 AC_MSG_RESULT($use_dbus)
641
642 dnl enable qr support
643 AC_MSG_CHECKING([if qr should be enabled])
644 if test x$have_qrencode = xno; then
645 if test x$use_qr == xyes; then
646 AC_MSG_ERROR("QR support requested but cannot be built. use --without-qrencode")
647 fi
648 AC_MSG_RESULT(no)
649 else
650 if test x$use_qr != xno; then
651 AC_MSG_RESULT(yes)
652 AC_DEFINE([USE_QRCODE],[1],[Define if QR support should be compiled in])
653 use_qr=yes
654 else
655 AC_MSG_RESULT(no)
656 fi
657 fi
658
659 if test x$use_tests = xyes; then
660 BUILD_TEST_QT="test"
661 fi
662fi
663
664if test x$use_tests = xyes; then
665 BUILD_TEST="test"
666fi
667
668AM_CONDITIONAL([TARGET_DARWIN], [test x$TARGET_OS = xdarwin])
669AM_CONDITIONAL([TARGET_WINDOWS], [test x$TARGET_OS = xwindows])
670AM_CONDITIONAL([USE_QRCODE], [test x$use_qr = xyes])
671AM_CONDITIONAL([USE_LCOV],[test x$use_lcov == xyes])
672AM_CONDITIONAL([USE_COMPARISON_TOOL],[test x$use_comparison_tool != xno])
673
674AC_DEFINE(CLIENT_VERSION_MAJOR, _CLIENT_VERSION_MAJOR, [Major version])
675AC_DEFINE(CLIENT_VERSION_MINOR, _CLIENT_VERSION_MINOR, [Minor version])
676AC_DEFINE(CLIENT_VERSION_REVISION, _CLIENT_VERSION_REVISION, [Build revision])
677AC_DEFINE(CLIENT_VERSION_BUILD, _CLIENT_VERSION_BUILD, [Version Build])
678AC_DEFINE(CLIENT_VERSION_IS_RELEASE, _CLIENT_VERSION_IS_RELEASE, [Version is release])
679AC_DEFINE(COPYRIGHT_YEAR, _COPYRIGHT_YEAR, [Version is release])
680AC_SUBST(CLIENT_VERSION_MAJOR, _CLIENT_VERSION_MAJOR)
681AC_SUBST(CLIENT_VERSION_MINOR, _CLIENT_VERSION_MINOR)
682AC_SUBST(CLIENT_VERSION_REVISION, _CLIENT_VERSION_REVISION)
683AC_SUBST(CLIENT_VERSION_BUILD, _CLIENT_VERSION_BUILD)
684AC_SUBST(CLIENT_VERSION_IS_RELEASE, _CLIENT_VERSION_IS_RELEASE)
685AC_SUBST(COPYRIGHT_YEAR, _COPYRIGHT_YEAR)
686
687
688AC_SUBST(USE_UPNP)
689AC_SUBST(USE_QRCODE)
690AC_SUBST(USE_IPV6)
691AC_SUBST(INCLUDES)
692AC_SUBST(BOOST_LIBS)
693AC_SUBST(MOC_DEFS)
694AC_SUBST(QT_INCLUDES)
695AC_SUBST(QT_TEST_LIBS)
696AC_SUBST(QT_LIBS)
697AC_SUBST(QT_DBUS_LIBS)
698AC_SUBST(QT_DBUS_INCLUDES)
699AC_SUBST(QT_TEST_INCLUDES)
700AC_SUBST(TESTDEFS)
701AC_SUBST(LEVELDB_TARGET_FLAGS)
702AC_SUBST(BUILD_QT)
703AC_SUBST(BUILD_TEST)
704AC_SUBST(BUILD_TEST_QT)
705AC_CONFIG_FILES([Makefile src/Makefile src/test/Makefile src/qt/Makefile src/qt/test/Makefile share/setup.nsi share/qt/Info.plist])
706AC_CONFIG_FILES([qa/pull-tester/run-bitcoind-for-test.sh],[chmod +x qa/pull-tester/run-bitcoind-for-test.sh])
707AC_CONFIG_FILES([qa/pull-tester/build-tests.sh],[chmod +x qa/pull-tester/build-tests.sh])
708AC_OUTPUT
This page took 0.089811 seconds and 4 git commands to generate.