diff options
author | Daniel Golle <daniel@makrotopia.org> | 2019-02-21 18:41:52 +0100 |
---|---|---|
committer | Daniel Golle <daniel@makrotopia.org> | 2019-02-23 13:47:53 +0100 |
commit | ad2d3029a06795dd72b32e5613e58dd1d3e0404f (patch) | |
tree | 7e89cecfd0526efcaf1b1a5aa43605000fec4247 /configure.ac | |
parent | f1e8076ed474a429aff32839ed5f8fc20371839c (diff) | |
download | gnunet-ad2d3029a06795dd72b32e5613e58dd1d3e0404f.tar.gz gnunet-ad2d3029a06795dd72b32e5613e58dd1d3e0404f.zip |
util: build with external libatomic
Recent versions of gcc on some architectures (MIPS, PPC, ...) moved
atomic functions into a separate library. As we are using atomic
load/store in util/time.c we may need to link libgnunetutil against
libatomic for __atomic_load_8 and __atomic_store_8 to be defined.
Fixes build problem on MIPS:
ld: ./.libs/libgnunetutil.so: undefined reference to `__atomic_store_8'
ld: ./.libs/libgnunetutil.so: undefined reference to `__atomic_load_8'
collect2: error: ld returned 1 exit status
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac index 87a60cb04..745300939 100644 --- a/configure.ac +++ b/configure.ac | |||
@@ -282,6 +282,7 @@ have_addrinfo_a=0 | |||
282 | AC_CHECK_LIB(anl, getaddrinfo_a, [have_addrinfo_a=1 AC_DEFINE(HAVE_GETADDRINFO_A,1,[getaddrinfo_a supported])]) | 282 | AC_CHECK_LIB(anl, getaddrinfo_a, [have_addrinfo_a=1 AC_DEFINE(HAVE_GETADDRINFO_A,1,[getaddrinfo_a supported])]) |
283 | AM_CONDITIONAL(HAVE_GETADDRINFO_A, [test "$have_addrinfo_a" = 1]) | 283 | AM_CONDITIONAL(HAVE_GETADDRINFO_A, [test "$have_addrinfo_a" = 1]) |
284 | 284 | ||
285 | |||
285 | # tests only run on Windows | 286 | # tests only run on Windows |
286 | if test "x$build_target" = "xmingw" | 287 | if test "x$build_target" = "xmingw" |
287 | then | 288 | then |
@@ -676,6 +677,8 @@ else | |||
676 | AC_DEFINE([HAVE_LIBCURL],[1],[Have CURL]) | 677 | AC_DEFINE([HAVE_LIBCURL],[1],[Have CURL]) |
677 | fi | 678 | fi |
678 | 679 | ||
680 | AC_SEARCH_LIBS(__atomic_load_8, atomic, [have_libatomic=1 AC_DEFINE(HAVE_LIBATOMIC,1,[external libatomic])]) | ||
681 | AM_CONDITIONAL(HAVE_LIBATOMIC, [test "$have_libatomic" = 1]) | ||
679 | 682 | ||
680 | # restore LIBS & CPPFLAGS | 683 | # restore LIBS & CPPFLAGS |
681 | LIBS=$SAVE_LIBS | 684 | LIBS=$SAVE_LIBS |