You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

bitcoin_qt.m4 17KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415
  1. dnl Helper for cases where a qt dependency is not met.
  2. dnl Output: If qt version is auto, set bitcoin_enable_qt to false. Else, exit.
  3. AC_DEFUN([BITCOIN_QT_FAIL],[
  4. if test "x$bitcoin_qt_want_version" = "xauto" && test x$bitcoin_qt_force != xyes; then
  5. if test x$bitcoin_enable_qt != xno; then
  6. AC_MSG_WARN([$1; bitcoin-qt frontend will not be built])
  7. fi
  8. bitcoin_enable_qt=no
  9. else
  10. AC_MSG_ERROR([$1])
  11. fi
  12. ])
  13. AC_DEFUN([BITCOIN_QT_CHECK],[
  14. if test "x$bitcoin_enable_qt" != "xno" && test x$bitcoin_qt_want_version != xno; then
  15. true
  16. $1
  17. else
  18. true
  19. $2
  20. fi
  21. ])
  22. dnl BITCOIN_QT_PATH_PROGS([FOO], [foo foo2], [/path/to/search/first], [continue if missing])
  23. dnl Helper for finding the path of programs needed for Qt.
  24. dnl Inputs: $1: Variable to be set
  25. dnl Inputs: $2: List of programs to search for
  26. dnl Inputs: $3: Look for $2 here before $PATH
  27. dnl Inputs: $4: If "yes", don't fail if $2 is not found.
  28. dnl Output: $1 is set to the path of $2 if found. $2 are searched in order.
  29. AC_DEFUN([BITCOIN_QT_PATH_PROGS],[
  30. BITCOIN_QT_CHECK([
  31. if test "x$3" != "x"; then
  32. AC_PATH_PROGS($1,$2,,$3)
  33. else
  34. AC_PATH_PROGS($1,$2)
  35. fi
  36. if test "x$$1" = "x" && test "x$4" != "xyes"; then
  37. BITCOIN_QT_FAIL([$1 not found])
  38. fi
  39. ])
  40. ])
  41. dnl Initialize qt input.
  42. dnl This must be called before any other BITCOIN_QT* macros to ensure that
  43. dnl input variables are set correctly.
  44. dnl CAUTION: Do not use this inside of a conditional.
  45. AC_DEFUN([BITCOIN_QT_INIT],[
  46. dnl enable qt support
  47. AC_ARG_WITH([gui],
  48. [AS_HELP_STRING([--with-gui@<:@=no|qt4|qt5|auto@:>@],
  49. [build bitcoin-qt GUI (default=auto, qt4 tried first)])],
  50. [
  51. bitcoin_qt_want_version=$withval
  52. if test x$bitcoin_qt_want_version = xyes; then
  53. bitcoin_qt_force=yes
  54. bitcoin_qt_want_version=auto
  55. fi
  56. ],
  57. [bitcoin_qt_want_version=auto])
  58. AC_ARG_WITH([qt-incdir],[AS_HELP_STRING([--with-qt-incdir=INC_DIR],[specify qt include path (overridden by pkgconfig)])], [qt_include_path=$withval], [])
  59. AC_ARG_WITH([qt-libdir],[AS_HELP_STRING([--with-qt-libdir=LIB_DIR],[specify qt lib path (overridden by pkgconfig)])], [qt_lib_path=$withval], [])
  60. AC_ARG_WITH([qt-plugindir],[AS_HELP_STRING([--with-qt-plugindir=PLUGIN_DIR],[specify qt plugin path (overridden by pkgconfig)])], [qt_plugin_path=$withval], [])
  61. AC_ARG_WITH([qt-translationdir],[AS_HELP_STRING([--with-qt-translationdir=PLUGIN_DIR],[specify qt translation path (overridden by pkgconfig)])], [qt_translation_path=$withval], [])
  62. AC_ARG_WITH([qt-bindir],[AS_HELP_STRING([--with-qt-bindir=BIN_DIR],[specify qt bin path])], [qt_bin_path=$withval], [])
  63. AC_ARG_WITH([qtdbus],
  64. [AS_HELP_STRING([--with-qtdbus],
  65. [enable DBus support (default is yes if qt is enabled and QtDBus is found)])],
  66. [use_dbus=$withval],
  67. [use_dbus=auto])
  68. AC_SUBST(QT_TRANSLATION_DIR,$qt_translation_path)
  69. ])
  70. dnl Find the appropriate version of Qt libraries and includes.
  71. dnl Inputs: $1: Whether or not pkg-config should be used. yes|no. Default: yes.
  72. dnl Inputs: $2: If $1 is "yes" and --with-gui=auto, which qt version should be
  73. dnl tried first.
  74. dnl Outputs: See _BITCOIN_QT_FIND_LIBS_*
  75. dnl Outputs: Sets variables for all qt-related tools.
  76. dnl Outputs: bitcoin_enable_qt, bitcoin_enable_qt_dbus, bitcoin_enable_qt_test
  77. AC_DEFUN([BITCOIN_QT_CONFIGURE],[
  78. use_pkgconfig=$1
  79. if test x$use_pkgconfig == x; then
  80. use_pkgconfig=yes
  81. fi
  82. if test x$use_pkgconfig = xyes; then
  83. BITCOIN_QT_CHECK([_BITCOIN_QT_FIND_LIBS_WITH_PKGCONFIG([$2])])
  84. else
  85. BITCOIN_QT_CHECK([_BITCOIN_QT_FIND_LIBS_WITHOUT_PKGCONFIG])
  86. fi
  87. dnl This is ugly and complicated. Yuck. Works as follows:
  88. dnl We can't discern whether Qt4 builds are static or not. For Qt5, we can
  89. dnl check a header to find out. When Qt is built statically, some plugins must
  90. dnl be linked into the final binary as well. These plugins have changed between
  91. dnl Qt4 and Qt5. With Qt5, languages moved into core and the WindowsIntegration
  92. dnl plugin was added. Since we can't tell if Qt4 is static or not, it is
  93. dnl assumed for windows builds.
  94. dnl _BITCOIN_QT_CHECK_STATIC_PLUGINS does a quick link-check and appends the
  95. dnl results to QT_LIBS.
  96. BITCOIN_QT_CHECK([
  97. TEMP_CPPFLAGS=$CPPFLAGS
  98. CPPFLAGS=$QT_INCLUDES
  99. if test x$bitcoin_qt_got_major_vers == x5; then
  100. _BITCOIN_QT_IS_STATIC
  101. if test x$bitcoin_cv_static_qt == xyes; then
  102. AC_DEFINE(QT_STATICPLUGIN, 1, [Define this symbol if qt plugins are static])
  103. if test x$qt_plugin_path != x; then
  104. QT_LIBS="$QT_LIBS -L$qt_plugin_path/accessible"
  105. QT_LIBS="$QT_LIBS -L$qt_plugin_path/platforms"
  106. fi
  107. if test x$use_pkgconfig = xyes; then
  108. PKG_CHECK_MODULES([QTPLATFORM], [Qt5PlatformSupport], [QT_LIBS="$QTPLATFORM_LIBS $QT_LIBS"])
  109. fi
  110. _BITCOIN_QT_CHECK_STATIC_PLUGINS([Q_IMPORT_PLUGIN(AccessibleFactory)], [-lqtaccessiblewidgets])
  111. if test x$TARGET_OS == xwindows; then
  112. _BITCOIN_QT_CHECK_STATIC_PLUGINS([Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin)],[-lqwindows])
  113. AC_DEFINE(QT_QPA_PLATFORM_WINDOWS, 1, [Define this symbol if the qt platform is windows])
  114. elif test x$TARGET_OS == xlinux; then
  115. PKG_CHECK_MODULES([X11XCB], [x11-xcb], [QT_LIBS="$X11XCB_LIBS $QT_LIBS"])
  116. _BITCOIN_QT_CHECK_STATIC_PLUGINS([Q_IMPORT_PLUGIN(QXcbIntegrationPlugin)],[-lqxcb -lxcb-static])
  117. AC_DEFINE(QT_QPA_PLATFORM_XCB, 1, [Define this symbol if the qt platform is xcb])
  118. elif test x$TARGET_OS == xdarwin; then
  119. if test x$use_pkgconfig = xyes; then
  120. PKG_CHECK_MODULES([QTPRINT], [Qt5PrintSupport], [QT_LIBS="$QTPRINT_LIBS $QT_LIBS"])
  121. fi
  122. AX_CHECK_LINK_FLAG([[-framework IOKit]],[QT_LIBS="$QT_LIBS -framework IOKit"],[AC_MSG_ERROR(could not iokit framework)])
  123. _BITCOIN_QT_CHECK_STATIC_PLUGINS([Q_IMPORT_PLUGIN(QCocoaIntegrationPlugin)],[-lqcocoa])
  124. AC_DEFINE(QT_QPA_PLATFORM_COCOA, 1, [Define this symbol if the qt platform is cocoa])
  125. fi
  126. fi
  127. else
  128. if test x$TARGET_OS == xwindows; then
  129. AC_DEFINE(QT_STATICPLUGIN, 1, [Define this symbol if qt plugins are static])
  130. if test x$qt_plugin_path != x; then
  131. QT_LIBS="$QT_LIBS -L$qt_plugin_path/accessible"
  132. QT_LIBS="$QT_LIBS -L$qt_plugin_path/codecs"
  133. fi
  134. _BITCOIN_QT_CHECK_STATIC_PLUGINS([
  135. Q_IMPORT_PLUGIN(qcncodecs)
  136. Q_IMPORT_PLUGIN(qjpcodecs)
  137. Q_IMPORT_PLUGIN(qtwcodecs)
  138. Q_IMPORT_PLUGIN(qkrcodecs)
  139. Q_IMPORT_PLUGIN(AccessibleFactory)],
  140. [-lqcncodecs -lqjpcodecs -lqtwcodecs -lqkrcodecs -lqtaccessiblewidgets])
  141. fi
  142. fi
  143. CPPFLAGS=$TEMP_CPPFLAGS
  144. ])
  145. if test x$use_pkgconfig$qt_bin_path = xyes; then
  146. if test x$bitcoin_qt_got_major_vers = x5; then
  147. qt_bin_path="`$PKG_CONFIG --variable=host_bins Qt5Core 2>/dev/null`"
  148. fi
  149. fi
  150. BITCOIN_QT_PATH_PROGS([MOC], [moc-qt${bitcoin_qt_got_major_vers} moc${bitcoin_qt_got_major_vers} moc], $qt_bin_path)
  151. BITCOIN_QT_PATH_PROGS([UIC], [uic-qt${bitcoin_qt_got_major_vers} uic${bitcoin_qt_got_major_vers} uic], $qt_bin_path)
  152. BITCOIN_QT_PATH_PROGS([RCC], [rcc-qt${bitcoin_qt_got_major_vers} rcc${bitcoin_qt_got_major_vers} rcc], $qt_bin_path)
  153. BITCOIN_QT_PATH_PROGS([LRELEASE], [lrelease-qt${bitcoin_qt_got_major_vers} lrelease${bitcoin_qt_got_major_vers} lrelease], $qt_bin_path)
  154. BITCOIN_QT_PATH_PROGS([LUPDATE], [lupdate-qt${bitcoin_qt_got_major_vers} lupdate${bitcoin_qt_got_major_vers} lupdate],$qt_bin_path, yes)
  155. MOC_DEFS='-DHAVE_CONFIG_H -I$(srcdir)'
  156. case $host in
  157. *darwin*)
  158. BITCOIN_QT_CHECK([
  159. MOC_DEFS="${MOC_DEFS} -DQ_OS_MAC"
  160. base_frameworks="-framework Foundation -framework ApplicationServices -framework AppKit"
  161. AX_CHECK_LINK_FLAG([[$base_frameworks]],[QT_LIBS="$QT_LIBS $base_frameworks"],[AC_MSG_ERROR(could not find base frameworks)])
  162. ])
  163. ;;
  164. *mingw*)
  165. BITCOIN_QT_CHECK([
  166. AX_CHECK_LINK_FLAG([[-mwindows]],[QT_LDFLAGS="$QT_LDFLAGS -mwindows"],[AC_MSG_WARN(-mwindows linker support not detected)])
  167. ])
  168. esac
  169. dnl enable qt support
  170. AC_MSG_CHECKING(whether to build Bitcoin Core GUI)
  171. BITCOIN_QT_CHECK([
  172. bitcoin_enable_qt=yes
  173. bitcoin_enable_qt_test=yes
  174. if test x$have_qt_test = xno; then
  175. bitcoin_enable_qt_test=no
  176. fi
  177. bitcoin_enable_qt_dbus=no
  178. if test x$use_dbus != xno && test x$have_qt_dbus = xyes; then
  179. bitcoin_enable_qt_dbus=yes
  180. fi
  181. if test x$use_dbus = xyes && test x$have_qt_dbus = xno; then
  182. AC_MSG_ERROR("libQtDBus not found. Install libQtDBus or remove --with-qtdbus.")
  183. fi
  184. if test x$LUPDATE == x; then
  185. AC_MSG_WARN("lupdate is required to update qt translations")
  186. fi
  187. ],[
  188. bitcoin_enable_qt=no
  189. ])
  190. AC_MSG_RESULT([$bitcoin_enable_qt (Qt${bitcoin_qt_got_major_vers})])
  191. AC_SUBST(QT_INCLUDES)
  192. AC_SUBST(QT_LIBS)
  193. AC_SUBST(QT_LDFLAGS)
  194. AC_SUBST(QT_DBUS_INCLUDES)
  195. AC_SUBST(QT_DBUS_LIBS)
  196. AC_SUBST(QT_TEST_INCLUDES)
  197. AC_SUBST(QT_TEST_LIBS)
  198. AC_SUBST(QT_SELECT, qt${bitcoin_qt_got_major_vers})
  199. AC_SUBST(MOC_DEFS)
  200. ])
  201. dnl All macros below are internal and should _not_ be used from the main
  202. dnl configure.ac.
  203. dnl ----
  204. dnl Internal. Check if the included version of Qt is Qt5.
  205. dnl Requires: INCLUDES must be populated as necessary.
  206. dnl Output: bitcoin_cv_qt5=yes|no
  207. AC_DEFUN([_BITCOIN_QT_CHECK_QT5],[
  208. AC_CACHE_CHECK(for Qt 5, bitcoin_cv_qt5,[
  209. AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
  210. [[#include <QtCore>]],
  211. [[
  212. #if QT_VERSION < 0x050000
  213. choke me
  214. #else
  215. return 0;
  216. #endif
  217. ]])],
  218. [bitcoin_cv_qt5=yes],
  219. [bitcoin_cv_qt5=no])
  220. ])])
  221. dnl Internal. Check if the linked version of Qt was built as static libs.
  222. dnl Requires: Qt5. This check cannot determine if Qt4 is static.
  223. dnl Requires: INCLUDES and LIBS must be populated as necessary.
  224. dnl Output: bitcoin_cv_static_qt=yes|no
  225. dnl Output: Defines QT_STATICPLUGIN if plugins are static.
  226. AC_DEFUN([_BITCOIN_QT_IS_STATIC],[
  227. AC_CACHE_CHECK(for static Qt, bitcoin_cv_static_qt,[
  228. AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
  229. [[#include <QtCore>]],
  230. [[
  231. #if defined(QT_STATIC)
  232. return 0;
  233. #else
  234. choke me
  235. #endif
  236. ]])],
  237. [bitcoin_cv_static_qt=yes],
  238. [bitcoin_cv_static_qt=no])
  239. ])
  240. if test xbitcoin_cv_static_qt = xyes; then
  241. AC_DEFINE(QT_STATICPLUGIN, 1, [Define this symbol for static Qt plugins])
  242. fi
  243. ])
  244. dnl Internal. Check if the link-requirements for static plugins are met.
  245. dnl Requires: INCLUDES and LIBS must be populated as necessary.
  246. dnl Inputs: $1: A series of Q_IMPORT_PLUGIN().
  247. dnl Inputs: $2: The libraries that resolve $1.
  248. dnl Output: QT_LIBS is prepended or configure exits.
  249. AC_DEFUN([_BITCOIN_QT_CHECK_STATIC_PLUGINS],[
  250. AC_MSG_CHECKING(for static Qt plugins: $2)
  251. CHECK_STATIC_PLUGINS_TEMP_LIBS="$LIBS"
  252. LIBS="$2 $QT_LIBS $LIBS"
  253. AC_LINK_IFELSE([AC_LANG_PROGRAM([[
  254. #define QT_STATICPLUGIN
  255. #include <QtPlugin>
  256. $1]],
  257. [[return 0;]])],
  258. [AC_MSG_RESULT(yes); QT_LIBS="$2 $QT_LIBS"],
  259. [AC_MSG_RESULT(no); BITCOIN_QT_FAIL(Could not resolve: $2)])
  260. LIBS="$CHECK_STATIC_PLUGINS_TEMP_LIBS"
  261. ])
  262. dnl Internal. Find Qt libraries using pkg-config.
  263. dnl Inputs: bitcoin_qt_want_version (from --with-gui=). The version to check
  264. dnl first.
  265. dnl Inputs: $1: If bitcoin_qt_want_version is "auto", check for this version
  266. dnl first.
  267. dnl Outputs: All necessary QT_* variables are set.
  268. dnl Outputs: bitcoin_qt_got_major_vers is set to "4" or "5".
  269. dnl Outputs: have_qt_test and have_qt_dbus are set (if applicable) to yes|no.
  270. AC_DEFUN([_BITCOIN_QT_FIND_LIBS_WITH_PKGCONFIG],[
  271. m4_ifdef([PKG_CHECK_MODULES],[
  272. auto_priority_version=$1
  273. if test x$auto_priority_version == x; then
  274. auto_priority_version=qt5
  275. fi
  276. if test x$bitcoin_qt_want_version == xqt5 || ( test x$bitcoin_qt_want_version == xauto && test x$auto_priority_version == xqt5 ); then
  277. QT_LIB_PREFIX=Qt5
  278. bitcoin_qt_got_major_vers=5
  279. else
  280. QT_LIB_PREFIX=Qt
  281. bitcoin_qt_got_major_vers=4
  282. fi
  283. qt5_modules="Qt5Core Qt5Gui Qt5Network Qt5Widgets"
  284. qt4_modules="QtCore QtGui QtNetwork"
  285. BITCOIN_QT_CHECK([
  286. if test x$bitcoin_qt_want_version == xqt5 || ( test x$bitcoin_qt_want_version == xauto && test x$auto_priority_version == xqt5 ); then
  287. PKG_CHECK_MODULES([QT], [$qt5_modules], [QT_INCLUDES="$QT_CFLAGS"; have_qt=yes],[have_qt=no])
  288. elif test x$bitcoin_qt_want_version == xqt4 || ( test x$bitcoin_qt_want_version == xauto && test x$auto_priority_version == xqt4 ); then
  289. PKG_CHECK_MODULES([QT], [$qt4_modules], [QT_INCLUDES="$QT_CFLAGS"; have_qt=yes], [have_qt=no])
  290. fi
  291. dnl qt version is set to 'auto' and the preferred version wasn't found. Now try the other.
  292. if test x$have_qt == xno && test x$bitcoin_qt_want_version == xauto; then
  293. if test x$auto_priority_version = x$qt5; then
  294. PKG_CHECK_MODULES([QT], [$qt4_modules], [QT_INCLUDES="$QT_CFLAGS"; have_qt=yes; QT_LIB_PREFIX=Qt; bitcoin_qt_got_major_vers=4], [have_qt=no])
  295. else
  296. PKG_CHECK_MODULES([QT], [$qt5_modules], [QT_INCLUDES="$QT_CFLAGS"; have_qt=yes; QT_LIB_PREFIX=Qt5; bitcoin_qt_got_major_vers=5], [have_qt=no])
  297. fi
  298. fi
  299. if test x$have_qt != xyes; then
  300. have_qt=no
  301. BITCOIN_QT_FAIL([Qt dependencies not found])
  302. fi
  303. ])
  304. BITCOIN_QT_CHECK([
  305. PKG_CHECK_MODULES([QT_TEST], [${QT_LIB_PREFIX}Test], [QT_TEST_INCLUDES="$QT_TEST_CFLAGS"; have_qt_test=yes], [have_qt_test=no])
  306. if test x$use_dbus != xno; then
  307. PKG_CHECK_MODULES([QT_DBUS], [${QT_LIB_PREFIX}DBus], [QT_DBUS_INCLUDES="$QT_DBUS_CFLAGS"; have_qt_dbus=yes], [have_qt_dbus=no])
  308. fi
  309. ])
  310. ])
  311. true; dnl
  312. ])
  313. dnl Internal. Find Qt libraries without using pkg-config. Version is deduced
  314. dnl from the discovered headers.
  315. dnl Inputs: bitcoin_qt_want_version (from --with-gui=). The version to use.
  316. dnl If "auto", the version will be discovered by _BITCOIN_QT_CHECK_QT5.
  317. dnl Outputs: All necessary QT_* variables are set.
  318. dnl Outputs: bitcoin_qt_got_major_vers is set to "4" or "5".
  319. dnl Outputs: have_qt_test and have_qt_dbus are set (if applicable) to yes|no.
  320. AC_DEFUN([_BITCOIN_QT_FIND_LIBS_WITHOUT_PKGCONFIG],[
  321. TEMP_CPPFLAGS="$CPPFLAGS"
  322. TEMP_LIBS="$LIBS"
  323. BITCOIN_QT_CHECK([
  324. if test x$qt_include_path != x; then
  325. QT_INCLUDES="-I$qt_include_path -I$qt_include_path/QtCore -I$qt_include_path/QtGui -I$qt_include_path/QtWidgets -I$qt_include_path/QtNetwork -I$qt_include_path/QtTest -I$qt_include_path/QtDBus"
  326. CPPFLAGS="$QT_INCLUDES $CPPFLAGS"
  327. fi
  328. ])
  329. BITCOIN_QT_CHECK([AC_CHECK_HEADER([QtPlugin],,BITCOIN_QT_FAIL(QtCore headers missing))])
  330. BITCOIN_QT_CHECK([AC_CHECK_HEADER([QApplication],, BITCOIN_QT_FAIL(QtGui headers missing))])
  331. BITCOIN_QT_CHECK([AC_CHECK_HEADER([QLocalSocket],, BITCOIN_QT_FAIL(QtNetwork headers missing))])
  332. BITCOIN_QT_CHECK([
  333. if test x$bitcoin_qt_want_version = xauto; then
  334. _BITCOIN_QT_CHECK_QT5
  335. fi
  336. if test x$bitcoin_cv_qt5 == xyes || test x$bitcoin_qt_want_version = xqt5; then
  337. QT_LIB_PREFIX=Qt5
  338. bitcoin_qt_got_major_vers=5
  339. else
  340. QT_LIB_PREFIX=Qt
  341. bitcoin_qt_got_major_vers=4
  342. fi
  343. ])
  344. BITCOIN_QT_CHECK([
  345. LIBS=
  346. if test x$qt_lib_path != x; then
  347. LIBS="$LIBS -L$qt_lib_path"
  348. fi
  349. if test x$TARGET_OS == xwindows; then
  350. AC_CHECK_LIB([imm32], [main],, BITCOIN_QT_FAIL(libimm32 not found))
  351. fi
  352. ])
  353. BITCOIN_QT_CHECK(AC_CHECK_LIB([z] ,[main],,AC_MSG_WARN([zlib not found. Assuming qt has it built-in])))
  354. BITCOIN_QT_CHECK(AC_CHECK_LIB([png] ,[main],,AC_MSG_WARN([libpng not found. Assuming qt has it built-in])))
  355. BITCOIN_QT_CHECK(AC_CHECK_LIB([jpeg] ,[main],,AC_MSG_WARN([libjpeg not found. Assuming qt has it built-in])))
  356. BITCOIN_QT_CHECK(AC_CHECK_LIB([pcre16] ,[main],,AC_MSG_WARN([libpcre16 not found. Assuming qt has it built-in])))
  357. BITCOIN_QT_CHECK(AC_CHECK_LIB([${QT_LIB_PREFIX}Core] ,[main],,BITCOIN_QT_FAIL(lib$QT_LIB_PREFIXCore not found)))
  358. BITCOIN_QT_CHECK(AC_CHECK_LIB([${QT_LIB_PREFIX}Gui] ,[main],,BITCOIN_QT_FAIL(lib$QT_LIB_PREFIXGui not found)))
  359. BITCOIN_QT_CHECK(AC_CHECK_LIB([${QT_LIB_PREFIX}Network],[main],,BITCOIN_QT_FAIL(lib$QT_LIB_PREFIXNetwork not found)))
  360. if test x$bitcoin_qt_got_major_vers == x5; then
  361. BITCOIN_QT_CHECK(AC_CHECK_LIB([${QT_LIB_PREFIX}Widgets],[main],,BITCOIN_QT_FAIL(lib$QT_LIB_PREFIXWidgets not found)))
  362. fi
  363. QT_LIBS="$LIBS"
  364. LIBS="$TEMP_LIBS"
  365. BITCOIN_QT_CHECK([
  366. LIBS=
  367. if test x$qt_lib_path != x; then
  368. LIBS="-L$qt_lib_path"
  369. fi
  370. AC_CHECK_LIB([${QT_LIB_PREFIX}Test], [main],, have_qt_test=no)
  371. AC_CHECK_HEADER([QTest],, have_qt_test=no)
  372. QT_TEST_LIBS="$LIBS"
  373. if test x$use_dbus != xno; then
  374. LIBS=
  375. if test x$qt_lib_path != x; then
  376. LIBS="-L$qt_lib_path"
  377. fi
  378. AC_CHECK_LIB([${QT_LIB_PREFIX}DBus], [main],, have_qt_dbus=no)
  379. AC_CHECK_HEADER([QtDBus],, have_qt_dbus=no)
  380. QT_DBUS_LIBS="$LIBS"
  381. fi
  382. ])
  383. CPPFLAGS="$TEMP_CPPFLAGS"
  384. LIBS="$TEMP_LIBS"
  385. ])