]> granicus.if.org Git - gc/commitdiff
Fix external libatomic_ops pkg-config-based detection
authorIvan Maidanski <ivmai@mail.ru>
Mon, 29 May 2017 07:51:44 +0000 (10:51 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Tue, 30 May 2017 13:30:08 +0000 (16:30 +0300)
Fall back to AC_CHECK_HEADER-based detection of libatomic_ops library
if PKG_CHECK_MODULES failed to find the library.

* configure.ac [missing_libatomic_ops=true]: Call
AC_CHECK_HEADER(atomic_ops.h) and set missing_libatomic_ops=false if
atomic_ops.h is found; add comment.

configure.ac

index 7195b9bd1d7b8bb945affd3260d1cb780088d560..9f2ad18472c2ed0e2b11b33e15796887b47a38fb 100644 (file)
@@ -948,7 +948,10 @@ missing_libatomic_ops=false
 AS_IF([test x"$with_libatomic_ops" != xno -a x"$THREADS" != xnone],
   [ PKG_CHECK_MODULES([ATOMIC_OPS], [atomic_ops], [],
                       [ missing_libatomic_ops=true ]) ])
-AS_IF([test x$missing_libatomic_ops = xtrue ],
+# Retry with AC_CHECK_HEADER if PKG_CHECK_MODULES failed.
+AS_IF([test x$missing_libatomic_ops = xtrue],
+      [ AC_CHECK_HEADER([atomic_ops.h], [missing_libatomic_ops=false]) ])
+AS_IF([test x$missing_libatomic_ops = xtrue],
       [ AS_IF([test x"$with_libatomic_ops" != xcheck],
               [ AC_MSG_ERROR([An external libatomic_ops was not found]) ])
         with_libatomic_ops=no ])