mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-03-05 14:06:27 -05:00
build: test for __declspec(dllexport) in configure
This should work for GCC and Clang when building for Windows targets.
This commit is contained in:
parent
1624e17b54
commit
7cd0a69664
2 changed files with 16 additions and 7 deletions
13
configure.ac
13
configure.ac
|
@ -813,7 +813,6 @@ if test x$ac_cv_sys_large_files != x &&
|
||||||
CPPFLAGS="$CPPFLAGS -D_LARGE_FILES=$ac_cv_sys_large_files"
|
CPPFLAGS="$CPPFLAGS -D_LARGE_FILES=$ac_cv_sys_large_files"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
AX_GCC_FUNC_ATTRIBUTE([dllexport])
|
|
||||||
AX_GCC_FUNC_ATTRIBUTE([dllimport])
|
AX_GCC_FUNC_ATTRIBUTE([dllimport])
|
||||||
|
|
||||||
if test x$use_glibc_compat != xno; then
|
if test x$use_glibc_compat != xno; then
|
||||||
|
@ -1000,6 +999,18 @@ AC_COMPILE_IFELSE([AC_LANG_SOURCE([
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|
||||||
|
AC_MSG_CHECKING([for dllexport attribute])
|
||||||
|
AC_COMPILE_IFELSE([AC_LANG_SOURCE([
|
||||||
|
__declspec(dllexport) int foo(void);
|
||||||
|
int main(){}
|
||||||
|
])],
|
||||||
|
[
|
||||||
|
AC_DEFINE(HAVE_DLLEXPORT_ATTRIBUTE,1,[Define if the dllexport attribute is supported.])
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
],
|
||||||
|
[AC_MSG_RESULT(no)]
|
||||||
|
)
|
||||||
|
|
||||||
dnl thread_local is currently disabled when building with glibc back compat.
|
dnl thread_local is currently disabled when building with glibc back compat.
|
||||||
dnl Our minimum supported glibc is 2.17, however support for thread_local
|
dnl Our minimum supported glibc is 2.17, however support for thread_local
|
||||||
dnl did not arrive in glibc until 2.18.
|
dnl did not arrive in glibc until 2.18.
|
||||||
|
|
|
@ -11,12 +11,10 @@
|
||||||
#if defined(BUILD_BITCOIN_INTERNAL) && defined(HAVE_CONFIG_H)
|
#if defined(BUILD_BITCOIN_INTERNAL) && defined(HAVE_CONFIG_H)
|
||||||
#include <config/bitcoin-config.h>
|
#include <config/bitcoin-config.h>
|
||||||
#if defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
#if defined(DLL_EXPORT)
|
#if defined(HAVE_DLLEXPORT_ATTRIBUTE)
|
||||||
#if defined(HAVE_FUNC_ATTRIBUTE_DLLEXPORT)
|
#define EXPORT_SYMBOL __declspec(dllexport)
|
||||||
#define EXPORT_SYMBOL __declspec(dllexport)
|
#else
|
||||||
#else
|
#define EXPORT_SYMBOL
|
||||||
#define EXPORT_SYMBOL
|
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
#elif defined(HAVE_DEFAULT_VISIBILITY_ATTRIBUTE)
|
#elif defined(HAVE_DEFAULT_VISIBILITY_ATTRIBUTE)
|
||||||
#define EXPORT_SYMBOL __attribute__ ((visibility ("default")))
|
#define EXPORT_SYMBOL __attribute__ ((visibility ("default")))
|
||||||
|
|
Loading…
Add table
Reference in a new issue