diff configure.in @ 3692:3e474e5b2986

[project @ 2000-07-05 15:26:04 by jwe]
author jwe
date Wed, 05 Jul 2000 15:26:05 +0000
parents 55e59236c5e5
children 8ce0d75eb4e3
line wrap: on
line diff
--- a/configure.in	Mon Jul 03 01:24:15 2000 +0000
+++ b/configure.in	Wed Jul 05 15:26:05 2000 +0000
@@ -21,7 +21,7 @@
 ### Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 ### 02111-1307, USA. 
 
-AC_REVISION($Revision: 1.330 $)
+AC_REVISION($Revision: 1.331 $)
 AC_PREREQ(2.9)
 AC_INIT(src/octave.cc)
 AC_CONFIG_HEADER(config.h)
@@ -537,67 +537,70 @@
   fi
 fi
 
-# remember current libs, so we can check if any libs were found below.
-blas_save_LIBS="$LIBS"
-
 AC_ARG_WITH(fastblas, [  --without-fastblas      use included (generic) BLAS and LAPACK], with_fastblas=$withval, with_fastblas=yes)
 if test "$with_fastblas" = "no"; then
-  blas_save_LIBS="different from $LIBS so tests fail below"
+  BLAS_LIBS=" "
 elif test "$with_fastblas" != "yes"; then
   # user specified a BLAS library to try on the command line
   AC_CHECK_LIB($with_fastblas, $dgemm_func, 
-	       LIBS="-l$with_fastblas $LIBS", , $FLIBS)
+	       BLAS_LIBS="-l$with_fastblas", , $FLIBS)
 fi
 
-if test "$blas_save_LIBS" = "$LIBS"; then
+if test "x$BLAS_LIBS" = x; then
   # Checks for ATLAS BLAS library:
-  AC_CHECK_LIB(atlas, ATL_xerbla)
-  if test "$blas_save_LIBS" != "$LIBS"; then
+  AC_CHECK_LIB(atlas, ATL_xerbla, BLAS_LIBS="-latlas")
+  if test "x$BLAS_LIBS" != x; then
     # check for other atlas libs:
-    AC_CHECK_LIB(cblas, cblas_dgemm)
+    AC_CHECK_LIB(cblas, cblas_dgemm,BLAS_LIBS="-lcblas $BLAS_LIBS",,$BLAS_LIBS)
     AC_CHECK_LIB(f77blas, $dgemm_func, 
-		 LIBS="-lf77blas $LIBS", , $FLIBS)
+		 BLAS_LIBS="-lf77blas $BLAS_LIBS", , $BLAS_LIBS $FLIBS)
   fi
 fi
 
-if test "$blas_save_LIBS" = "$LIBS"; then
+if test "x$BLAS_LIBS" = x; then
   # BLAS in Alpha CXML library?
-  AC_CHECK_LIB(cxml, $dgemm_func, LIBS="-lcxml $LIBS", , $FLIBS)
+  AC_CHECK_LIB(cxml, $dgemm_func, BLAS_LIBS="-lcxml", , $FLIBS)
 fi
 
-if test "$blas_save_LIBS" = "$LIBS"; then
+if test "x$BLAS_LIBS" = x; then
   # BLAS in Alpha DXML library? (now called CXML, see above)
-  AC_CHECK_LIB(dxml, $dgemm_func, LIBS="-ldxml $LIBS", , $FLIBS)
+  AC_CHECK_LIB(dxml, $dgemm_func, BLAS_LIBS="-ldxml", , $FLIBS)
 fi
 
-if test "$blas_save_LIBS" = "$LIBS"; then
+if test "x$BLAS_LIBS" = x; then
   # Check for BLAS in Sun Performance library:
-  AC_CHECK_LIB(sunmath, acosp)
-  AC_CHECK_LIB(sunperf, $dgemm_func, LIBS="-xlic_lib=sunperf $LIBS")
+  AC_CHECK_LIB(sunmath, acosp, BLAS_LIBS="-lsunmath")
+  AC_CHECK_LIB(sunperf, $dgemm_func, BLAS_LIBS="-xlic_lib=sunperf $BLAS_LIBS",
+               , $BLAS_LIBS)
 fi
 
-if test "$blas_save_LIBS" = "$LIBS"; then
+if test "x$BLAS_LIBS" = x; then
   # Check for BLAS in SCSL and SGIMATH libraries (prefer SCSL):
   AC_CHECK_LIB(scs, $dgemm_func,
-               LIBS="-lscs $LIBS", 
+               BLAS_LIBS="-lscs", 
 	       AC_CHECK_LIB(complib.sgimath, $dgemm_func,
-			    LIBS="-lcomplib.sgimath $LIBS", , $FLIBS), $FLIBS)
+			    BLAS_LIBS="-lcomplib.sgimath", , $FLIBS), $FLIBS)
 fi
 
-if test "$blas_save_LIBS" = "$LIBS"; then
+if test "x$BLAS_LIBS" = x; then
   # Checks for BLAS in IBM ESSL library.  We must also link
   # with -lblas in this case (ESSL does not include the full BLAS):
   AC_CHECK_LIB(blas, zherk, 
 	       AC_CHECK_LIB(essl, $dgemm_func, 
-			    LIBS="-lessl -lblas $LIBS", , $FLIBS), , $FLIBS)
+			    BLAS_LIBS="-lessl -lblas", , $FLIBS), , $FLIBS)
 fi
 
-if test "$blas_save_LIBS" = "$LIBS"; then
+if test "x$BLAS_LIBS" = x; then
   # Finally, check for the generic BLAS library:
-  AC_CHECK_LIB(blas, $dgemm_func, LIBS="-lblas $LIBS", , $FLIBS)
+  AC_CHECK_LIB(blas, $dgemm_func, BLAS_LIBS="-lblas", , $FLIBS)
 fi
 
-if test "$blas_save_LIBS" != "$LIBS"; then
+if test "$with_fastblas" = "no"; then
+  # Unset BLAS_LIBS so that we know below that nothing was found.
+  BLAS_LIBS=""
+fi
+
+if test "x$BLAS_LIBS" != x; then
   BLAS_DIR=""  # don't build our own BLAS
 
 # Check for LAPACK library.  Note that ATLAS has its own liblapack.a,
@@ -609,10 +612,12 @@
 # doing AC_CHECK_FUNC if -llapack isn't found:
 
   AC_CHECK_LIB(lapack, $cheev_func, 
-	       [LIBS="-llapack $LIBS"; LAPACK_DIR=""],
-	       AC_CHECK_FUNC($cheev_func, LAPACK_DIR=""), $FLIBS)
+	       [BLAS_LIBS="-llapack $BLAS_LIBS"; LAPACK_DIR=""],
+	       AC_CHECK_FUNC($cheev_func, LAPACK_DIR=""), $BLAS_LIBS $FLIBS)
 fi
 
+AC_SUBST(BLAS_LIBS)
+
 ### Handle dynamic linking and shared library options.
 
 ### Allow the user to experiment with dynamic linking using dlopen/dlsym.