From 940a69c7ea8e1b13b166e87904230523cb25d422 Mon Sep 17 00:00:00 2001
From: Jaroslav Hajek <hajek@hajek.vzlu.local>
Date: Tue, 21 Sep 2010 07:22:24 +0200
Subject: [PATCH] avoid caching issues in ax_blas.m4

---
 m4/ax_blas.m4 |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/m4/ax_blas.m4 b/m4/ax_blas.m4
index c5e545e..f180501 100644
--- a/m4/ax_blas.m4
+++ b/m4/ax_blas.m4
@@ -101,7 +101,9 @@ fi
 # BLAS linked to by default?  (happens on some supercomputers)
 if test $ax_blas_ok = no; then
 	save_LIBS="$LIBS"; LIBS="$LIBS"
-	AC_CHECK_FUNC($sgemm, [ax_blas_ok=yes])
+	AC_MSG_CHECKING([if $sgemm is being linked in already])
+	AC_TRY_LINK_FUNC($sgemm, [ax_blas_ok=yes])
+	AC_MSG_RESULT($ax_blas_ok)
 	LIBS="$save_LIBS"
 fi
 
@@ -134,7 +136,9 @@ fi
 # BLAS in Apple vecLib library?
 if test $ax_blas_ok = no; then
 	save_LIBS="$LIBS"; LIBS="-framework vecLib $LIBS"
-	AC_CHECK_FUNC($sgemm, [ax_blas_ok=yes;BLAS_LIBS="-framework vecLib"])
+	AC_MSG_CHECKING([for $sgemm in -framework vecLib])
+	AC_TRY_LINK_FUNC($sgemm, [ax_blas_ok=yes;BLAS_LIBS="-framework vecLib"])
+	AC_MSG_RESULT($ax_blas_ok)
 	LIBS="$save_LIBS"
 fi
 
-- 
1.6.4.2

