From 2716c296e5ed6b85363d96bf861a497b99f75fd0 Mon Sep 17 00:00:00 2001
From: Matthieu Schaller <schaller@strw.leidenuniv.nl>
Date: Mon, 12 Feb 2018 14:58:04 +0100
Subject: [PATCH] Better detection of the GSL library.

---
 configure.ac | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index 31808e5128..85446a9d9a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -406,8 +406,13 @@ AC_CHECK_LIB(m,sqrt,,AC_MSG_ERROR(something is wrong with the math library!))
 
 # Check for GSL
 have_gsl="no"
-AC_CHECK_LIB([gslcblas],[cblas_dgemm])
-AC_CHECK_LIB([gsl],[gsl_integration_qag])
+AC_CHECK_LIB([gslcblas], [cblas_dgemm])
+AC_CHECK_LIB([gsl],
+	     [gsl_integration_qag],
+	     [AC_DEFINE([HAVE_LIBGSL], [1], [Define to 1 if you have the `gsl' library (-lgsl).])]
+	     [AX_APPEND_FLAG(-lgsl, LDFLAGS)]
+	     [have_gsl="yes"],
+	     [have_gsl="no"])
 
 # Check for pthreads.
 AX_PTHREAD([LIBS="$PTHREAD_LIBS $LIBS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
-- 
GitLab