configure: Check for and explicitly link against -latomic

Some C libraries, such as uClibc, require an explicit link for some atomic
functions. Check for any libatomic, and explcily link it.
This commit is contained in:
Martin Willi
2016-06-14 14:27:20 +02:00
parent 796c36ade1
commit 518a5b2ece
13 changed files with 20 additions and 12 deletions
+5
View File
@@ -490,6 +490,11 @@ LIBS=$DLLIB
AC_SEARCH_LIBS(pthread_create, pthread, [PTHREADLIB=$LIBS])
AC_SUBST(PTHREADLIB)
# uClibc requires explicit -latomic for __atomic_* operations
LIBS=""
AC_SEARCH_LIBS(__atomic_load, atomic, [ATOMICLIB=$LIBS])
AC_SUBST(ATOMICLIB)
LIBS=$saved_LIBS
# ------------------------------------------------------