Removes explicit linking of libblas and liblapack for when linking with MKL

From: Maxime Boissonneault <maxime.boissonneault@calculquebec.ca>
Date: Wed, 22 Feb 2017 

diff -ru igraph-0.7.1.orig/configure igraph-0.7.1/configure
--- igraph-0.7.1.orig/configure	2014-04-22 17:55:00.000000000 +0000
+++ igraph-0.7.1/configure	2017-02-21 15:00:00.398921297 +0000
@@ -17266,13 +17266,13 @@
 fi
 
 if test "$internal_blas" = "no"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for daxpy_ in -lblas" >&5
-$as_echo_n "checking for daxpy_ in -lblas... " >&6; }
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for daxpy_ in " >&5
+$as_echo_n "checking for daxpy_ in ... " >&6; }
 if ${ac_cv_lib_blas_daxpy_+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lblas  $LIBS"
+LIBS="  $LIBS"
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
@@ -17307,16 +17307,16 @@
 #define HAVE_LIBBLAS 1
 _ACEOF
 
-  LIBS="-lblas $LIBS"
+  LIBS=" $LIBS"
 
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for daxpy in -lblas" >&5
-$as_echo_n "checking for daxpy in -lblas... " >&6; }
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for daxpy in " >&5
+$as_echo_n "checking for daxpy in ... " >&6; }
 if ${ac_cv_lib_blas_daxpy+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lblas  $LIBS"
+LIBS="  $LIBS"
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
@@ -17351,16 +17351,16 @@
 #define HAVE_LIBBLAS 1
 _ACEOF
 
-  LIBS="-lblas $LIBS"
+  LIBS=" $LIBS"
 
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DAXPY_ in -lblas" >&5
-$as_echo_n "checking for DAXPY_ in -lblas... " >&6; }
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DAXPY_ in " >&5
+$as_echo_n "checking for DAXPY_ in ... " >&6; }
 if ${ac_cv_lib_blas_DAXPY_+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lblas  $LIBS"
+LIBS="  $LIBS"
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
@@ -17395,16 +17395,16 @@
 #define HAVE_LIBBLAS 1
 _ACEOF
 
-  LIBS="-lblas $LIBS"
+  LIBS=" $LIBS"
 
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DAXPY in -lblas" >&5
-$as_echo_n "checking for DAXPY in -lblas... " >&6; }
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DAXPY in " >&5
+$as_echo_n "checking for DAXPY in ... " >&6; }
 if ${ac_cv_lib_blas_DAXPY+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lblas  $LIBS"
+LIBS="  $LIBS"
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
@@ -17439,7 +17439,7 @@
 #define HAVE_LIBBLAS 1
 _ACEOF
 
-  LIBS="-lblas $LIBS"
+  LIBS=" $LIBS"
 
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
@@ -17452,8 +17452,8 @@
 
 fi
 
-  LDFLAGS="${LDFLAGS} -lblas"
-  PKGCONFIG_LIBS_PRIVATE="${PKGCONFIG_LIBS_PRIVATE} -lblas"
+  LDFLAGS="${LDFLAGS} "
+  PKGCONFIG_LIBS_PRIVATE="${PKGCONFIG_LIBS_PRIVATE} "
 else
 
 $as_echo "#define INTERNAL_BLAS 1" >>confdefs.h
@@ -17461,13 +17461,13 @@
 fi
 
 if test "$internal_lapack" = "no"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlarnv_ in -llapack" >&5
-$as_echo_n "checking for dlarnv_ in -llapack... " >&6; }
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlarnv_ in " >&5
+$as_echo_n "checking for dlarnv_ in ... " >&6; }
 if ${ac_cv_lib_lapack_dlarnv_+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-llapack  $LIBS"
+LIBS="  $LIBS"
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
@@ -17502,16 +17502,16 @@
 #define HAVE_LIBLAPACK 1
 _ACEOF
 
-  LIBS="-llapack $LIBS"
+  LIBS=" $LIBS"
 
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlarnv in -llapack" >&5
-$as_echo_n "checking for dlarnv in -llapack... " >&6; }
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlarnv in " >&5
+$as_echo_n "checking for dlarnv in ... " >&6; }
 if ${ac_cv_lib_lapack_dlarnv+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-llapack  $LIBS"
+LIBS="  $LIBS"
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
@@ -17546,16 +17546,16 @@
 #define HAVE_LIBLAPACK 1
 _ACEOF
 
-  LIBS="-llapack $LIBS"
+  LIBS=" $LIBS"
 
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DLARNV_ in -llapack" >&5
-$as_echo_n "checking for DLARNV_ in -llapack... " >&6; }
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DLARNV_ in " >&5
+$as_echo_n "checking for DLARNV_ in ... " >&6; }
 if ${ac_cv_lib_lapack_DLARNV_+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-llapack  $LIBS"
+LIBS="  $LIBS"
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
@@ -17590,16 +17590,16 @@
 #define HAVE_LIBLAPACK 1
 _ACEOF
 
-  LIBS="-llapack $LIBS"
+  LIBS=" $LIBS"
 
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DLARNV in -llapack" >&5
-$as_echo_n "checking for DLARNV in -llapack... " >&6; }
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DLARNV in " >&5
+$as_echo_n "checking for DLARNV in ... " >&6; }
 if ${ac_cv_lib_lapack_DLARNV+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-llapack  $LIBS"
+LIBS="  $LIBS"
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
@@ -17634,7 +17634,7 @@
 #define HAVE_LIBLAPACK 1
 _ACEOF
 
-  LIBS="-llapack $LIBS"
+  LIBS=" $LIBS"
 
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
@@ -17647,8 +17647,8 @@
 
 fi
 
-  LDFLAGS="${LDFLAGS} -llapack"
-  PKGCONFIG_LIBS_PRIVATE="${PKGCONFIG_LIBS_PRIVATE} -llapack"
+  LDFLAGS="${LDFLAGS} "
+  PKGCONFIG_LIBS_PRIVATE="${PKGCONFIG_LIBS_PRIVATE} "
 else
 
 $as_echo "#define INTERNAL_LAPACK 1" >>confdefs.h
diff -ru igraph-0.7.1.orig/configure.ac igraph-0.7.1/configure.ac
--- igraph-0.7.1.orig/configure.ac	2014-04-22 13:01:17.000000000 +0000
+++ igraph-0.7.1/configure.ac	2017-02-21 15:00:00.398921297 +0000
@@ -235,9 +235,9 @@
      AC_CHECK_LIB([blas], [daxpy], [],
         AC_CHECK_LIB([blas], [DAXPY_], [],
            AC_CHECK_LIB([blas], [DAXPY], [],
-	      [AC_MSG_RESULT(not found, trying to use -lblas anyway.)]))))
-  LDFLAGS="${LDFLAGS} -lblas"
-  PKGCONFIG_LIBS_PRIVATE="${PKGCONFIG_LIBS_PRIVATE} -lblas"
+	      [AC_MSG_RESULT(not found, trying to use  anyway.)]))))
+  LDFLAGS="${LDFLAGS} "
+  PKGCONFIG_LIBS_PRIVATE="${PKGCONFIG_LIBS_PRIVATE} "
 else
   AC_DEFINE([INTERNAL_BLAS], [1], [Define to 1 if you use the internal BLAS library])
 fi
@@ -247,9 +247,9 @@
      AC_CHECK_LIB([lapack], [dlarnv], [],
         AC_CHECK_LIB([lapack], [DLARNV_], [],
            AC_CHECK_LIB([lapack], [DLARNV], [],
-	      [AC_MSG_RESULT(not found, trying to use -llapack anyway.)]))))
-  LDFLAGS="${LDFLAGS} -llapack"
-  PKGCONFIG_LIBS_PRIVATE="${PKGCONFIG_LIBS_PRIVATE} -llapack"
+	      [AC_MSG_RESULT(not found, trying to use  anyway.)]))))
+  LDFLAGS="${LDFLAGS} "
+  PKGCONFIG_LIBS_PRIVATE="${PKGCONFIG_LIBS_PRIVATE} "
 else
   AC_DEFINE([INTERNAL_LAPACK], [1], [Define to 1 if you use the internal LAPACK library])
 fi
diff -ru igraph-0.7.1.orig/tests/testsuite igraph-0.7.1/tests/testsuite
--- igraph-0.7.1.orig/tests/testsuite	2014-04-22 17:55:15.000000000 +0000
+++ igraph-0.7.1/tests/testsuite	2017-02-21 15:00:00.417921103 +0000
@@ -3793,9 +3793,9 @@
 
 
 { set +x
-$as_echo "$at_srcdir/types.at:136: \$CC \${abs_top_srcdir}/examples/simple/igraph_sparsemat2.c -I\${abs_top_srcdir}/include -I\${abs_top_srcdir}/src -I\${abs_top_builddir}/include -I\${abs_top_builddir} -L\${abs_top_builddir}/src/.libs -ligraph -lm -lblas -o itest"
+$as_echo "$at_srcdir/types.at:136: \$CC \${abs_top_srcdir}/examples/simple/igraph_sparsemat2.c -I\${abs_top_srcdir}/include -I\${abs_top_srcdir}/src -I\${abs_top_builddir}/include -I\${abs_top_builddir} -L\${abs_top_builddir}/src/.libs -ligraph -lm  -o itest"
 at_fn_check_prepare_notrace 'a ${...} parameter expansion' "types.at:136"
-( $at_check_trace; $CC ${abs_top_srcdir}/examples/simple/igraph_sparsemat2.c -I${abs_top_srcdir}/include -I${abs_top_srcdir}/src -I${abs_top_builddir}/include -I${abs_top_builddir} -L${abs_top_builddir}/src/.libs -ligraph -lm -lblas -o itest
+( $at_check_trace; $CC ${abs_top_srcdir}/examples/simple/igraph_sparsemat2.c -I${abs_top_srcdir}/include -I${abs_top_srcdir}/src -I${abs_top_builddir}/include -I${abs_top_builddir} -L${abs_top_builddir}/src/.libs -ligraph -lm  -o itest
 ) >>"$at_stdout" 2>>"$at_stderr" 5>&-
 at_status=$? at_failed=false
 $at_check_filter
diff -ru igraph-0.7.1.orig/tests/types.at igraph-0.7.1/tests/types.at
--- igraph-0.7.1.orig/tests/types.at	2014-04-15 13:00:46.000000000 +0000
+++ igraph-0.7.1/tests/types.at	2017-02-21 15:00:00.417921103 +0000
@@ -133,7 +133,7 @@
 AT_SETUP([Sparse matrix, multiplications (igraph_sparsemat_t): ])
 AT_KEYWORDS([sparse matrix igraph_sparsemat_t])
 AT_COMPILE_CHECK([simple/igraph_sparsemat2.c], [simple/igraph_sparsemat2.out],
-                 [], [INTERNAL], [-lblas])
+                 [], [INTERNAL], [])
 AT_CLEANUP
 
 AT_SETUP([Sparse matrix, indexing (igraph_sparsemat_t): ])
