From a445790fcdc7c854b4b96d35a2813abe79c657d4 Mon Sep 17 00:00:00 2001 From: Pieter Lexis Date: Fri, 11 Aug 2017 14:37:01 +0200 Subject: [PATCH] Fix libatomic detection on ppc64 Thanks @tjikkun! Closes #5456 (cherry picked from commit b16f46605d86a62e4f37bc1e2caab0c52fa9f75c) --- m4/pdns_check_os.m4 | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/m4/pdns_check_os.m4 b/m4/pdns_check_os.m4 index 2afdbb6bd4..9ff7b1b054 100644 --- a/m4/pdns_check_os.m4 +++ b/m4/pdns_check_os.m4 @@ -36,10 +36,12 @@ AC_DEFUN([PDNS_CHECK_OS],[ AM_CONDITIONAL([HAVE_SOLARIS], [test "x$have_solaris" = "xyes"]) case "$host" in - mips* | powerpc* ) - AX_CHECK_LINK_FLAG([-latomic], - [ : ], - [ AC_MSG_ERROR([Unable to link against libatomic, cannot continue]) ] + mips* | powerpc-* ) + AC_MSG_CHECKING([whether the linker accepts -latomic]) + LDFLAGS="-latomic $LDFLAGS" + AC_LINK_IFELSE([m4_default([],[AC_LANG_PROGRAM()])], + [AC_MSG_RESULT([yes])], + [AC_MSG_ERROR([Unable to link against libatomic, cannot continue])] ) LDFLAGS="-latomic $LDFLAGS" ;; -- 2.47.2