aboutsummaryrefslogtreecommitdiff
path: root/build-aux
diff options
context:
space:
mode:
Diffstat (limited to 'build-aux')
-rw-r--r--build-aux/m4/ax_boost_process.m4121
-rw-r--r--build-aux/m4/ax_boost_thread.m4187
-rw-r--r--build-aux/m4/ax_gcc_func_attribute.m4223
-rw-r--r--build-aux/m4/bitcoin_qt.m4133
4 files changed, 79 insertions, 585 deletions
diff --git a/build-aux/m4/ax_boost_process.m4 b/build-aux/m4/ax_boost_process.m4
deleted file mode 100644
index 5d20e67464..0000000000
--- a/build-aux/m4/ax_boost_process.m4
+++ /dev/null
@@ -1,121 +0,0 @@
-# ===========================================================================
-# https://www.gnu.org/software/autoconf-archive/ax_boost_process.html
-# ===========================================================================
-#
-# SYNOPSIS
-#
-# AX_BOOST_PROCESS
-#
-# DESCRIPTION
-#
-# Test for Process library from the Boost C++ libraries. The macro
-# requires a preceding call to AX_BOOST_BASE. Further documentation is
-# available at <http://randspringer.de/boost/index.html>.
-#
-# This macro calls:
-#
-# AC_SUBST(BOOST_PROCESS_LIB)
-#
-# And sets:
-#
-# HAVE_BOOST_PROCESS
-#
-# LICENSE
-#
-# Copyright (c) 2008 Thomas Porschberg <thomas@randspringer.de>
-# Copyright (c) 2008 Michael Tindal
-# Copyright (c) 2008 Daniel Casimiro <dan.casimiro@gmail.com>
-#
-# Copying and distribution of this file, with or without modification, are
-# permitted in any medium without royalty provided the copyright notice
-# and this notice are preserved. This file is offered as-is, without any
-# warranty.
-
-#serial 2
-
-AC_DEFUN([AX_BOOST_PROCESS],
-[
- AC_ARG_WITH([boost-process],
- AS_HELP_STRING([--with-boost-process@<:@=special-lib@:>@],
- [use the Process library from boost - it is possible to specify a certain library for the linker
- e.g. --with-boost-process=boost_process-gcc-mt ]),
- [
- if test "$withval" = "no"; then
- want_boost_process="no"
- elif test "$withval" = "yes"; then
- want_boost_process="yes"
- ax_boost_user_process_lib=""
- else
- want_boost_process="yes"
- ax_boost_user_process_lib="$withval"
- fi
- ],
- [want_boost_process="yes"]
- )
-
- if test "x$want_boost_process" = "xyes"; then
- AC_REQUIRE([AC_PROG_CC])
- AC_REQUIRE([AC_CANONICAL_BUILD])
- CPPFLAGS_SAVED="$CPPFLAGS"
- CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
- export CPPFLAGS
-
- LDFLAGS_SAVED="$LDFLAGS"
- LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
- export LDFLAGS
-
- AC_CACHE_CHECK(whether the Boost::Process library is available,
- ax_cv_boost_process,
- [AC_LANG_PUSH([C++])
- CXXFLAGS_SAVE=$CXXFLAGS
- CXXFLAGS=
-
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@include <boost/process.hpp>]],
- [[boost::process::child* child = new boost::process::child; delete child;]])],
- ax_cv_boost_process=yes, ax_cv_boost_process=no)
- CXXFLAGS=$CXXFLAGS_SAVE
- AC_LANG_POP([C++])
- ])
- if test "x$ax_cv_boost_process" = "xyes"; then
- AC_SUBST(BOOST_CPPFLAGS)
-
- AC_DEFINE(HAVE_BOOST_PROCESS,,[define if the Boost::Process library is available])
- BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'`
-
- LDFLAGS_SAVE=$LDFLAGS
- if test "x$ax_boost_user_process_lib" = "x"; then
- for libextension in `ls -r $BOOSTLIBDIR/libboost_process* 2>/dev/null | sed 's,.*/lib,,' | sed 's,\..*,,'` ; do
- ax_lib=${libextension}
- AC_CHECK_LIB($ax_lib, exit,
- [BOOST_PROCESS_LIB="-l$ax_lib"; AC_SUBST(BOOST_PROCESS_LIB) link_process="yes"; break],
- [link_process="no"])
- done
- if test "x$link_process" != "xyes"; then
- for libextension in `ls -r $BOOSTLIBDIR/boost_process* 2>/dev/null | sed 's,.*/,,' | sed -e 's,\..*,,'` ; do
- ax_lib=${libextension}
- AC_CHECK_LIB($ax_lib, exit,
- [BOOST_PROCESS_LIB="-l$ax_lib"; AC_SUBST(BOOST_PROCESS_LIB) link_process="yes"; break],
- [link_process="no"])
- done
- fi
-
- else
- for ax_lib in $ax_boost_user_process_lib boost_process-$ax_boost_user_process_lib; do
- AC_CHECK_LIB($ax_lib, exit,
- [BOOST_PROCESS_LIB="-l$ax_lib"; AC_SUBST(BOOST_PROCESS_LIB) link_process="yes"; break],
- [link_process="no"])
- done
-
- fi
- if test "x$ax_lib" = "x"; then
- AC_MSG_ERROR(Could not find a version of the Boost::Process library!)
- fi
- if test "x$link_process" = "xno"; then
- AC_MSG_ERROR(Could not link against $ax_lib !)
- fi
- fi
-
- CPPFLAGS="$CPPFLAGS_SAVED"
- LDFLAGS="$LDFLAGS_SAVED"
- fi
-])
diff --git a/build-aux/m4/ax_boost_thread.m4 b/build-aux/m4/ax_boost_thread.m4
deleted file mode 100644
index 75e80e6e75..0000000000
--- a/build-aux/m4/ax_boost_thread.m4
+++ /dev/null
@@ -1,187 +0,0 @@
-# ===========================================================================
-# https://www.gnu.org/software/autoconf-archive/ax_boost_thread.html
-# ===========================================================================
-#
-# SYNOPSIS
-#
-# AX_BOOST_THREAD
-#
-# DESCRIPTION
-#
-# Test for Thread library from the Boost C++ libraries. The macro requires
-# a preceding call to AX_BOOST_BASE. Further documentation is available at
-# <http://randspringer.de/boost/index.html>.
-#
-# This macro calls:
-#
-# AC_SUBST(BOOST_THREAD_LIB)
-#
-# And sets:
-#
-# HAVE_BOOST_THREAD
-#
-# LICENSE
-#
-# Copyright (c) 2009 Thomas Porschberg <thomas@randspringer.de>
-# Copyright (c) 2009 Michael Tindal
-#
-# Copying and distribution of this file, with or without modification, are
-# permitted in any medium without royalty provided the copyright notice
-# and this notice are preserved. This file is offered as-is, without any
-# warranty.
-
-#serial 33
-
-AC_DEFUN([AX_BOOST_THREAD],
-[
- AC_ARG_WITH([boost-thread],
- AS_HELP_STRING([--with-boost-thread@<:@=special-lib@:>@],
- [use the Thread library from boost -
- it is possible to specify a certain library for the linker
- e.g. --with-boost-thread=boost_thread-gcc-mt ]),
- [
- if test "$withval" = "yes"; then
- want_boost="yes"
- ax_boost_user_thread_lib=""
- else
- want_boost="yes"
- ax_boost_user_thread_lib="$withval"
- fi
- ],
- [want_boost="yes"]
- )
-
- if test "x$want_boost" = "xyes"; then
- AC_REQUIRE([AC_PROG_CC])
- AC_REQUIRE([AC_CANONICAL_BUILD])
- CPPFLAGS_SAVED="$CPPFLAGS"
- CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
- export CPPFLAGS
-
- LDFLAGS_SAVED="$LDFLAGS"
- LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
- export LDFLAGS
-
- AC_CACHE_CHECK(whether the Boost::Thread library is available,
- ax_cv_boost_thread,
- [AC_LANG_PUSH([C++])
- CXXFLAGS_SAVE=$CXXFLAGS
-
- case "x$host_os" in
- xsolaris )
- CXXFLAGS="-pthreads $CXXFLAGS"
- break;
- ;;
- xmingw32 )
- CXXFLAGS="-mthreads $CXXFLAGS"
- break;
- ;;
- *android* )
- break;
- ;;
- * )
- CXXFLAGS="-pthread $CXXFLAGS"
- break;
- ;;
- esac
-
- AC_COMPILE_IFELSE([
- AC_LANG_PROGRAM(
- [[@%:@include <boost/thread/thread.hpp>]],
- [[boost::thread_group thrds;
- return 0;]])],
- ax_cv_boost_thread=yes, ax_cv_boost_thread=no)
- CXXFLAGS=$CXXFLAGS_SAVE
- AC_LANG_POP([C++])
- ])
- if test "x$ax_cv_boost_thread" = "xyes"; then
- case "x$host_os" in
- xsolaris )
- BOOST_CPPFLAGS="-pthreads $BOOST_CPPFLAGS"
- break;
- ;;
- xmingw32 )
- BOOST_CPPFLAGS="-mthreads $BOOST_CPPFLAGS"
- break;
- ;;
- *android* )
- break;
- ;;
- * )
- BOOST_CPPFLAGS="-pthread $BOOST_CPPFLAGS"
- break;
- ;;
- esac
-
- AC_SUBST(BOOST_CPPFLAGS)
-
- AC_DEFINE(HAVE_BOOST_THREAD,,
- [define if the Boost::Thread library is available])
- BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'`
-
- LDFLAGS_SAVE=$LDFLAGS
- case "x$host_os" in
- *bsd* )
- LDFLAGS="-pthread $LDFLAGS"
- break;
- ;;
- esac
- if test "x$ax_boost_user_thread_lib" = "x"; then
- for libextension in `ls -r $BOOSTLIBDIR/libboost_thread* 2>/dev/null | sed 's,.*/lib,,' | sed 's,\..*,,'`; do
- ax_lib=${libextension}
- AC_CHECK_LIB($ax_lib, exit,
- [link_thread="yes"; break],
- [link_thread="no"])
- done
- if test "x$link_thread" != "xyes"; then
- for libextension in `ls -r $BOOSTLIBDIR/boost_thread* 2>/dev/null | sed 's,.*/,,' | sed 's,\..*,,'`; do
- ax_lib=${libextension}
- AC_CHECK_LIB($ax_lib, exit,
- [link_thread="yes"; break],
- [link_thread="no"])
- done
- fi
-
- else
- for ax_lib in $ax_boost_user_thread_lib boost_thread-$ax_boost_user_thread_lib; do
- AC_CHECK_LIB($ax_lib, exit,
- [link_thread="yes"; break],
- [link_thread="no"])
- done
-
- fi
- if test "x$ax_lib" = "x"; then
- AC_MSG_ERROR(Could not find a version of the Boost::Thread library!)
- fi
- if test "x$link_thread" = "xno"; then
- AC_MSG_ERROR(Could not link against $ax_lib !)
- else
- BOOST_THREAD_LIB="-l$ax_lib"
- case "x$host_os" in
- *bsd* )
- BOOST_LDFLAGS="-pthread $BOOST_LDFLAGS"
- break;
- ;;
- xsolaris )
- BOOST_THREAD_LIB="$BOOST_THREAD_LIB -lpthread"
- break;
- ;;
- xmingw32 )
- break;
- ;;
- *android* )
- break;
- ;;
- * )
- BOOST_THREAD_LIB="$BOOST_THREAD_LIB -lpthread"
- break;
- ;;
- esac
- AC_SUBST(BOOST_THREAD_LIB)
- fi
- fi
-
- CPPFLAGS="$CPPFLAGS_SAVED"
- LDFLAGS="$LDFLAGS_SAVED"
- fi
-])
diff --git a/build-aux/m4/ax_gcc_func_attribute.m4 b/build-aux/m4/ax_gcc_func_attribute.m4
deleted file mode 100644
index c788ca9bd4..0000000000
--- a/build-aux/m4/ax_gcc_func_attribute.m4
+++ /dev/null
@@ -1,223 +0,0 @@
-# ===========================================================================
-# http://www.gnu.org/software/autoconf-archive/ax_gcc_func_attribute.html
-# ===========================================================================
-#
-# SYNOPSIS
-#
-# AX_GCC_FUNC_ATTRIBUTE(ATTRIBUTE)
-#
-# DESCRIPTION
-#
-# This macro checks if the compiler supports one of GCC's function
-# attributes; many other compilers also provide function attributes with
-# the same syntax. Compiler warnings are used to detect supported
-# attributes as unsupported ones are ignored by default so quieting
-# warnings when using this macro will yield false positives.
-#
-# The ATTRIBUTE parameter holds the name of the attribute to be checked.
-#
-# If ATTRIBUTE is supported define HAVE_FUNC_ATTRIBUTE_<ATTRIBUTE>.
-#
-# The macro caches its result in the ax_cv_have_func_attribute_<attribute>
-# variable.
-#
-# The macro currently supports the following function attributes:
-#
-# alias
-# aligned
-# alloc_size
-# always_inline
-# artificial
-# cold
-# const
-# constructor
-# constructor_priority for constructor attribute with priority
-# deprecated
-# destructor
-# dllexport
-# dllimport
-# error
-# externally_visible
-# flatten
-# format
-# format_arg
-# gnu_inline
-# hot
-# ifunc
-# leaf
-# malloc
-# noclone
-# noinline
-# nonnull
-# noreturn
-# nothrow
-# optimize
-# pure
-# unused
-# used
-# visibility
-# warning
-# warn_unused_result
-# weak
-# weakref
-#
-# Unsuppored function attributes will be tested with a prototype returning
-# an int and not accepting any arguments and the result of the check might
-# be wrong or meaningless so use with care.
-#
-# LICENSE
-#
-# Copyright (c) 2013 Gabriele Svelto <gabriele.svelto@gmail.com>
-#
-# Copying and distribution of this file, with or without modification, are
-# permitted in any medium without royalty provided the copyright notice
-# and this notice are preserved. This file is offered as-is, without any
-# warranty.
-
-#serial 3
-
-AC_DEFUN([AX_GCC_FUNC_ATTRIBUTE], [
- AS_VAR_PUSHDEF([ac_var], [ax_cv_have_func_attribute_$1])
-
- AC_CACHE_CHECK([for __attribute__(($1))], [ac_var], [
- AC_LINK_IFELSE([AC_LANG_PROGRAM([
- m4_case([$1],
- [alias], [
- int foo( void ) { return 0; }
- int bar( void ) __attribute__(($1("foo")));
- ],
- [aligned], [
- int foo( void ) __attribute__(($1(32)));
- ],
- [alloc_size], [
- void *foo(int a) __attribute__(($1(1)));
- ],
- [always_inline], [
- inline __attribute__(($1)) int foo( void ) { return 0; }
- ],
- [artificial], [
- inline __attribute__(($1)) int foo( void ) { return 0; }
- ],
- [cold], [
- int foo( void ) __attribute__(($1));
- ],
- [const], [
- int foo( void ) __attribute__(($1));
- ],
- [constructor_priority], [
- int foo( void ) __attribute__((__constructor__(65535/2)));
- ],
- [constructor], [
- int foo( void ) __attribute__(($1));
- ],
- [deprecated], [
- int foo( void ) __attribute__(($1("")));
- ],
- [destructor], [
- int foo( void ) __attribute__(($1));
- ],
- [dllexport], [
- __attribute__(($1)) int foo( void ) { return 0; }
- ],
- [dllimport], [
- int foo( void ) __attribute__(($1));
- ],
- [error], [
- int foo( void ) __attribute__(($1("")));
- ],
- [externally_visible], [
- int foo( void ) __attribute__(($1));
- ],
- [flatten], [
- int foo( void ) __attribute__(($1));
- ],
- [format], [
- int foo(const char *p, ...) __attribute__(($1(printf, 1, 2)));
- ],
- [format_arg], [
- char *foo(const char *p) __attribute__(($1(1)));
- ],
- [gnu_inline], [
- inline __attribute__(($1)) int foo( void ) { return 0; }
- ],
- [hot], [
- int foo( void ) __attribute__(($1));
- ],
- [ifunc], [
- int my_foo( void ) { return 0; }
- static int (*resolve_foo(void))(void) { return my_foo; }
- int foo( void ) __attribute__(($1("resolve_foo")));
- ],
- [leaf], [
- __attribute__(($1)) int foo( void ) { return 0; }
- ],
- [malloc], [
- void *foo( void ) __attribute__(($1));
- ],
- [noclone], [
- int foo( void ) __attribute__(($1));
- ],
- [noinline], [
- __attribute__(($1)) int foo( void ) { return 0; }
- ],
- [nonnull], [
- int foo(char *p) __attribute__(($1(1)));
- ],
- [noreturn], [
- void foo( void ) __attribute__(($1));
- ],
- [nothrow], [
- int foo( void ) __attribute__(($1));
- ],
- [optimize], [
- __attribute__(($1(3))) int foo( void ) { return 0; }
- ],
- [pure], [
- int foo( void ) __attribute__(($1));
- ],
- [unused], [
- int foo( void ) __attribute__(($1));
- ],
- [used], [
- int foo( void ) __attribute__(($1));
- ],
- [visibility], [
- int foo_def( void ) __attribute__(($1("default")));
- int foo_hid( void ) __attribute__(($1("hidden")));
- int foo_int( void ) __attribute__(($1("internal")));
- int foo_pro( void ) __attribute__(($1("protected")));
- ],
- [warning], [
- int foo( void ) __attribute__(($1("")));
- ],
- [warn_unused_result], [
- int foo( void ) __attribute__(($1));
- ],
- [weak], [
- int foo( void ) __attribute__(($1));
- ],
- [weakref], [
- static int foo( void ) { return 0; }
- static int bar( void ) __attribute__(($1("foo")));
- ],
- [
- m4_warn([syntax], [Unsupported attribute $1, the test may fail])
- int foo( void ) __attribute__(($1));
- ]
- )], [])
- ],
- dnl GCC doesn't exit with an error if an unknown attribute is
- dnl provided but only outputs a warning, so accept the attribute
- dnl only if no warning were issued.
- [AS_IF([test -s conftest.err],
- [AS_VAR_SET([ac_var], [no])],
- [AS_VAR_SET([ac_var], [yes])])],
- [AS_VAR_SET([ac_var], [no])])
- ])
-
- AS_IF([test yes = AS_VAR_GET([ac_var])],
- [AC_DEFINE_UNQUOTED(AS_TR_CPP(HAVE_FUNC_ATTRIBUTE_$1), 1,
- [Define to 1 if the system has the `$1' function attribute])], [])
-
- AS_VAR_POPDEF([ac_var])
-])
diff --git a/build-aux/m4/bitcoin_qt.m4 b/build-aux/m4/bitcoin_qt.m4
index 658dfc5476..1fd88db08f 100644
--- a/build-aux/m4/bitcoin_qt.m4
+++ b/build-aux/m4/bitcoin_qt.m4
@@ -64,6 +64,13 @@ AC_DEFUN([BITCOIN_QT_INIT],[
],
[bitcoin_qt_want_version=auto])
+ AS_IF([test "x$with_gui" = xqt5_debug],
+ [AS_CASE([$host],
+ [*darwin*], [qt_lib_suffix=_debug],
+ [*mingw*], [qt_lib_suffix=d],
+ [qt_lib_suffix= ]); bitcoin_qt_want_version=qt5],
+ [qt_lib_suffix= ])
+
AC_ARG_WITH([qt-incdir],[AS_HELP_STRING([--with-qt-incdir=INC_DIR],[specify qt include path (overridden by pkgconfig)])], [qt_include_path=$withval], [])
AC_ARG_WITH([qt-libdir],[AS_HELP_STRING([--with-qt-libdir=LIB_DIR],[specify qt lib path (overridden by pkgconfig)])], [qt_lib_path=$withval], [])
AC_ARG_WITH([qt-plugindir],[AS_HELP_STRING([--with-qt-plugindir=PLUGIN_DIR],[specify qt plugin path (overridden by pkgconfig)])], [qt_plugin_path=$withval], [])
@@ -104,9 +111,7 @@ AC_DEFUN([BITCOIN_QT_CONFIGURE],[
dnl For Qt5, we can check a header to find out whether Qt is build
dnl statically. When Qt is built statically, some plugins must be linked into
dnl the final binary as well.
- dnl With Qt5, languages moved into core and the WindowsIntegration plugin was
- dnl added.
- dnl _BITCOIN_QT_CHECK_STATIC_PLUGINS does a quick link-check and appends the
+ dnl _BITCOIN_QT_CHECK_STATIC_PLUGIN does a quick link-check and appends the
dnl results to QT_LIBS.
BITCOIN_QT_CHECK([
TEMP_CPPFLAGS=$CPPFLAGS
@@ -115,20 +120,41 @@ AC_DEFUN([BITCOIN_QT_CONFIGURE],[
CXXFLAGS="$PIC_FLAGS $CXXFLAGS"
_BITCOIN_QT_IS_STATIC
if test "x$bitcoin_cv_static_qt" = xyes; then
- _BITCOIN_QT_FIND_STATIC_PLUGINS
+ _BITCOIN_QT_CHECK_STATIC_LIBS
+
+ if test "x$qt_plugin_path" != x; then
+ QT_LIBS="$QT_LIBS -L$qt_plugin_path/platforms -L$qt_plugin_path/styles"
+ if test -d "$qt_plugin_path/accessible"; then
+ QT_LIBS="$QT_LIBS -L$qt_plugin_path/accessible"
+ fi
+ if test -d "$qt_plugin_path/platforms/android"; then
+ QT_LIBS="$QT_LIBS -L$qt_plugin_path/platforms/android -lqtfreetype -lEGL"
+ fi
+ fi
+
AC_DEFINE(QT_STATICPLUGIN, 1, [Define this symbol if qt plugins are static])
if test "x$TARGET_OS" != xandroid; then
- _BITCOIN_QT_CHECK_STATIC_PLUGINS([Q_IMPORT_PLUGIN(QMinimalIntegrationPlugin)],[-lqminimal])
+ _BITCOIN_QT_CHECK_STATIC_PLUGIN([QMinimalIntegrationPlugin], [-lqminimal])
AC_DEFINE(QT_QPA_PLATFORM_MINIMAL, 1, [Define this symbol if the minimal qt platform exists])
fi
if test "x$TARGET_OS" = xwindows; then
- _BITCOIN_QT_CHECK_STATIC_PLUGINS([Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin)],[-lqwindows])
+ dnl Linking against wtsapi32 is required. See #17749 and
+ dnl https://bugreports.qt.io/browse/QTBUG-27097.
+ AX_CHECK_LINK_FLAG([-lwtsapi32], [QT_LIBS="$QT_LIBS -lwtsapi32"], [AC_MSG_ERROR([could not link against -lwtsapi32])])
+ _BITCOIN_QT_CHECK_STATIC_PLUGIN([QWindowsIntegrationPlugin], [-lqwindows])
AC_DEFINE(QT_QPA_PLATFORM_WINDOWS, 1, [Define this symbol if the qt platform is windows])
elif test "x$TARGET_OS" = xlinux; then
- _BITCOIN_QT_CHECK_STATIC_PLUGINS([Q_IMPORT_PLUGIN(QXcbIntegrationPlugin)],[-lqxcb -lxcb-static])
+ dnl workaround for https://bugreports.qt.io/browse/QTBUG-74874
+ AX_CHECK_LINK_FLAG([-lxcb-shm], [QT_LIBS="-lxcb-shm $QT_LIBS"], [AC_MSG_ERROR([could not link against -lxcb-shm])])
+ _BITCOIN_QT_CHECK_STATIC_PLUGIN([QXcbIntegrationPlugin], [-lqxcb -lxcb-static])
AC_DEFINE(QT_QPA_PLATFORM_XCB, 1, [Define this symbol if the qt platform is xcb])
elif test "x$TARGET_OS" = xdarwin; then
- _BITCOIN_QT_CHECK_STATIC_PLUGINS([Q_IMPORT_PLUGIN(QCocoaIntegrationPlugin)],[-lqcocoa])
+ AX_CHECK_LINK_FLAG([[-framework Carbon]],[QT_LIBS="$QT_LIBS -framework Carbon"],[AC_MSG_ERROR(could not link against Carbon framework)])
+ AX_CHECK_LINK_FLAG([[-framework IOSurface]],[QT_LIBS="$QT_LIBS -framework IOSurface"],[AC_MSG_ERROR(could not link against IOSurface framework)])
+ AX_CHECK_LINK_FLAG([[-framework Metal]],[QT_LIBS="$QT_LIBS -framework Metal"],[AC_MSG_ERROR(could not link against Metal framework)])
+ AX_CHECK_LINK_FLAG([[-framework QuartzCore]],[QT_LIBS="$QT_LIBS -framework QuartzCore"],[AC_MSG_ERROR(could not link against QuartzCore framework)])
+ _BITCOIN_QT_CHECK_STATIC_PLUGIN([QCocoaIntegrationPlugin], [-lqcocoa])
+ _BITCOIN_QT_CHECK_STATIC_PLUGIN([QMacStylePlugin], [-lqmacstyle])
AC_DEFINE(QT_QPA_PLATFORM_COCOA, 1, [Define this symbol if the qt platform is cocoa])
elif test "x$TARGET_OS" = xandroid; then
QT_LIBS="-Wl,--export-dynamic,--undefined=JNI_OnLoad -lqtforandroid -ljnigraphics -landroid -lqtfreetype -lQt5EglSupport $QT_LIBS"
@@ -277,51 +303,50 @@ AC_DEFUN([_BITCOIN_QT_IS_STATIC],[
])
])
-dnl Internal. Check if the link-requirements for static plugins are met.
+dnl Internal. Check if the link-requirements for a static plugin are met.
+dnl
+dnl _BITCOIN_QT_CHECK_STATIC_PLUGIN(PLUGIN, LIBRARIES)
+dnl --------------------------------------------------
+dnl
dnl Requires: INCLUDES and LIBS must be populated as necessary.
-dnl Inputs: $1: A series of Q_IMPORT_PLUGIN().
+dnl Inputs: $1: A static plugin name.
dnl Inputs: $2: The libraries that resolve $1.
dnl Output: QT_LIBS is prepended or configure exits.
-AC_DEFUN([_BITCOIN_QT_CHECK_STATIC_PLUGINS],[
- AC_MSG_CHECKING(for static Qt plugins: $2)
+AC_DEFUN([_BITCOIN_QT_CHECK_STATIC_PLUGIN], [
+ AC_MSG_CHECKING([for $1 ($2)])
CHECK_STATIC_PLUGINS_TEMP_LIBS="$LIBS"
- LIBS="$2 $QT_LIBS $LIBS"
+ LIBS="$2${qt_lib_suffix} $QT_LIBS $LIBS"
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
- #define QT_STATICPLUGIN
- #include <QtPlugin>
- $1]],
- [[return 0;]])],
- [AC_MSG_RESULT(yes); QT_LIBS="$2 $QT_LIBS"],
- [AC_MSG_RESULT(no); BITCOIN_QT_FAIL(Could not resolve: $2)])
+ #include <QtPlugin>
+ Q_IMPORT_PLUGIN($1)
+ ]])],
+ [AC_MSG_RESULT([yes]); QT_LIBS="$2${qt_lib_suffix} $QT_LIBS"],
+ [AC_MSG_RESULT([no]); BITCOIN_QT_FAIL([$1 not found.])])
LIBS="$CHECK_STATIC_PLUGINS_TEMP_LIBS"
])
-dnl Internal. Find paths necessary for linking qt static plugins
-dnl Inputs: qt_plugin_path. optional.
-dnl Outputs: QT_LIBS is appended
-AC_DEFUN([_BITCOIN_QT_FIND_STATIC_PLUGINS],[
- if test "x$qt_plugin_path" != x; then
- QT_LIBS="$QT_LIBS -L$qt_plugin_path/platforms"
- if test -d "$qt_plugin_path/accessible"; then
- QT_LIBS="$QT_LIBS -L$qt_plugin_path/accessible"
- fi
- if test -d "$qt_plugin_path/platforms/android"; then
- QT_LIBS="$QT_LIBS -L$qt_plugin_path/platforms/android -lqtfreetype -lEGL"
- fi
- PKG_CHECK_MODULES([QTFONTDATABASE], [Qt5FontDatabaseSupport], [QT_LIBS="-lQt5FontDatabaseSupport $QT_LIBS"])
- PKG_CHECK_MODULES([QTEVENTDISPATCHER], [Qt5EventDispatcherSupport], [QT_LIBS="-lQt5EventDispatcherSupport $QT_LIBS"])
- PKG_CHECK_MODULES([QTTHEME], [Qt5ThemeSupport], [QT_LIBS="-lQt5ThemeSupport $QT_LIBS"])
- PKG_CHECK_MODULES([QTDEVICEDISCOVERY], [Qt5DeviceDiscoverySupport], [QT_LIBS="-lQt5DeviceDiscoverySupport $QT_LIBS"])
- PKG_CHECK_MODULES([QTACCESSIBILITY], [Qt5AccessibilitySupport], [QT_LIBS="-lQt5AccessibilitySupport $QT_LIBS"])
- PKG_CHECK_MODULES([QTFB], [Qt5FbSupport], [QT_LIBS="-lQt5FbSupport $QT_LIBS"])
- if test "x$TARGET_OS" = xlinux; then
- PKG_CHECK_MODULES([QTXCBQPA], [Qt5XcbQpa], [QT_LIBS="$QTXCBQPA_LIBS $QT_LIBS"])
- elif test "x$TARGET_OS" = xdarwin; then
- PKG_CHECK_MODULES([QTCLIPBOARD], [Qt5ClipboardSupport], [QT_LIBS="-lQt5ClipboardSupport $QT_LIBS"])
- PKG_CHECK_MODULES([QTGRAPHICS], [Qt5GraphicsSupport], [QT_LIBS="-lQt5GraphicsSupport $QT_LIBS"])
- PKG_CHECK_MODULES([QTCGL], [Qt5CglSupport], [QT_LIBS="-lQt5CglSupport $QT_LIBS"])
- fi
- fi
+dnl Internal. Check Qt static libs with PKG_CHECK_MODULES.
+dnl
+dnl _BITCOIN_QT_CHECK_STATIC_LIBS
+dnl -----------------------------
+dnl
+dnl Inputs: no inputs.
+dnl Outputs: QT_LIBS is prepended.
+AC_DEFUN([_BITCOIN_QT_CHECK_STATIC_LIBS], [
+ PKG_CHECK_MODULES([QTFONTDATABASE], [Qt5FontDatabaseSupport${qt_lib_suffix}], [QT_LIBS="-lQt5FontDatabaseSupport${qt_lib_suffix} $QT_LIBS"])
+ PKG_CHECK_MODULES([QTEVENTDISPATCHER], [Qt5EventDispatcherSupport${qt_lib_suffix}], [QT_LIBS="-lQt5EventDispatcherSupport${qt_lib_suffix} $QT_LIBS"])
+ PKG_CHECK_MODULES([QTTHEME], [Qt5ThemeSupport${qt_lib_suffix}], [QT_LIBS="-lQt5ThemeSupport${qt_lib_suffix} $QT_LIBS"])
+ PKG_CHECK_MODULES([QTDEVICEDISCOVERY], [Qt5DeviceDiscoverySupport${qt_lib_suffix}], [QT_LIBS="-lQt5DeviceDiscoverySupport${qt_lib_suffix} $QT_LIBS"])
+ PKG_CHECK_MODULES([QTACCESSIBILITY], [Qt5AccessibilitySupport${qt_lib_suffix}], [QT_LIBS="-lQt5AccessibilitySupport${qt_lib_suffix} $QT_LIBS"])
+ PKG_CHECK_MODULES([QTFB], [Qt5FbSupport${qt_lib_suffix}], [QT_LIBS="-lQt5FbSupport${qt_lib_suffix} $QT_LIBS"])
+ if test "x$TARGET_OS" = xlinux; then
+ PKG_CHECK_MODULES([QTXCBQPA], [Qt5XcbQpa], [QT_LIBS="$QTXCBQPA_LIBS $QT_LIBS"])
+ elif test "x$TARGET_OS" = xdarwin; then
+ PKG_CHECK_MODULES([QTCLIPBOARD], [Qt5ClipboardSupport${qt_lib_suffix}], [QT_LIBS="-lQt5ClipboardSupport${qt_lib_suffix} $QT_LIBS"])
+ PKG_CHECK_MODULES([QTGRAPHICS], [Qt5GraphicsSupport${qt_lib_suffix}], [QT_LIBS="-lQt5GraphicsSupport${qt_lib_suffix} $QT_LIBS"])
+ elif test "x$TARGET_OS" = xwindows; then
+ PKG_CHECK_MODULES([QTWINDOWSUIAUTOMATION], [Qt5WindowsUIAutomationSupport${qt_lib_suffix}], [QT_LIBS="-lQt5WindowsUIAutomationSupport${qt_lib_suffix} $QT_LIBS"])
+ fi
])
dnl Internal. Find Qt libraries using pkg-config.
@@ -329,26 +354,26 @@ dnl Outputs: All necessary QT_* variables are set.
dnl Outputs: have_qt_test and have_qt_dbus are set (if applicable) to yes|no.
AC_DEFUN([_BITCOIN_QT_FIND_LIBS],[
BITCOIN_QT_CHECK([
- PKG_CHECK_MODULES([QT_CORE], [${qt_lib_prefix}Core $qt_version], [],
- [BITCOIN_QT_FAIL([${qt_lib_prefix}Core $qt_version not found])])
+ PKG_CHECK_MODULES([QT_CORE], [${qt_lib_prefix}Core${qt_lib_suffix} $qt_version], [],
+ [BITCOIN_QT_FAIL([${qt_lib_prefix}Core${qt_lib_suffix} $qt_version not found])])
])
BITCOIN_QT_CHECK([
- PKG_CHECK_MODULES([QT_GUI], [${qt_lib_prefix}Gui $qt_version], [],
- [BITCOIN_QT_FAIL([${qt_lib_prefix}Gui $qt_version not found])])
+ PKG_CHECK_MODULES([QT_GUI], [${qt_lib_prefix}Gui${qt_lib_suffix} $qt_version], [],
+ [BITCOIN_QT_FAIL([${qt_lib_prefix}Gui${qt_lib_suffix} $qt_version not found])])
])
BITCOIN_QT_CHECK([
- PKG_CHECK_MODULES([QT_WIDGETS], [${qt_lib_prefix}Widgets $qt_version], [],
- [BITCOIN_QT_FAIL([${qt_lib_prefix}Widgets $qt_version not found])])
+ PKG_CHECK_MODULES([QT_WIDGETS], [${qt_lib_prefix}Widgets${qt_lib_suffix} $qt_version], [],
+ [BITCOIN_QT_FAIL([${qt_lib_prefix}Widgets${qt_lib_suffix} $qt_version not found])])
])
BITCOIN_QT_CHECK([
- PKG_CHECK_MODULES([QT_NETWORK], [${qt_lib_prefix}Network $qt_version], [],
- [BITCOIN_QT_FAIL([${qt_lib_prefix}Network $qt_version not found])])
+ PKG_CHECK_MODULES([QT_NETWORK], [${qt_lib_prefix}Network${qt_lib_suffix} $qt_version], [],
+ [BITCOIN_QT_FAIL([${qt_lib_prefix}Network${qt_lib_suffix} $qt_version not found])])
])
QT_INCLUDES="$QT_CORE_CFLAGS $QT_GUI_CFLAGS $QT_WIDGETS_CFLAGS $QT_NETWORK_CFLAGS"
QT_LIBS="$QT_CORE_LIBS $QT_GUI_LIBS $QT_WIDGETS_LIBS $QT_NETWORK_LIBS"
BITCOIN_QT_CHECK([
- PKG_CHECK_MODULES([QT_TEST], [${qt_lib_prefix}Test $qt_version], [QT_TEST_INCLUDES="$QT_TEST_CFLAGS"; have_qt_test=yes], [have_qt_test=no])
+ PKG_CHECK_MODULES([QT_TEST], [${qt_lib_prefix}Test${qt_lib_suffix} $qt_version], [QT_TEST_INCLUDES="$QT_TEST_CFLAGS"; have_qt_test=yes], [have_qt_test=no])
if test "x$use_dbus" != xno; then
PKG_CHECK_MODULES([QT_DBUS], [${qt_lib_prefix}DBus $qt_version], [QT_DBUS_INCLUDES="$QT_DBUS_CFLAGS"; have_qt_dbus=yes], [have_qt_dbus=no])
fi