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>
Mon, 29 May 2017 07:51:44 +0000 (10:51 +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 7b22877..1754606 100644 (file)
@@ -980,7 +980,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 ])