aboutsummaryrefslogtreecommitdiff
blob: 743f57922642a1679dd56847fc04f759a422e7a9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
diff --git a/configure.in b/configure.in
index 0f85137..dff76b3 100644
--- a/configure.in
+++ b/configure.in
@@ -38,6 +38,7 @@ AC_LANG([C++])
 AC_PROG_LIBTOOL
 AC_PROG_YACC
 AM_PROG_LEX
+PKG_PROG_PKG_CONFIG
 
 dnl Check for standard C+headers
 GINAC_STD_CXX_HEADERS
@@ -111,47 +112,13 @@ AC_CHECK_SIZEOF(long)
 AC_CHECK_SIZEOF(long long)
   
 dnl Checking for Gnu Sci Lib
-CONFIG_GSL="yes"
-AC_ARG_ENABLE([gsl],[
-	AS_HELP_STRING([--enable-gsl], [Use GNU scientific library [[default=yes]]])],
-	[ if test "x$enableval" = "xno"; then CONFIG_GSL="no"; fi], [])
-
-if test "$CONFIG_GSL" = "yes"; then
-	AC_CHECK_HEADERS(gsl/gsl_blas.h)
-	AC_CHECK_HEADERS(gsl/gsl_eigen.h)
-	if test "$ac_cv_header_gsl_gsl_blas_h" != "yes" -o "$ac_cv_header_gsl_gsl_eigen_h" != "yes"; then
-		CONFIG_GSL="no"
-	fi
-fi
-if test "$CONFIG_GSL" = "yes"; then
-	save_LIBS="$LIBS"
-	AC_CHECK_LIB(gslcblas, main, [], [CONFIG_GSL="no"])
-	AC_CHECK_LIB(gsl, gsl_sf_gamma, [], [CONFIG_GSL="no"])
-	LIBS="$save_LIBS"
-  fi
-GSL_LIBS=""
-if test "$CONFIG_GSL" = "yes"; then
-	GSL_LIBS="-lgsl -lgslcblas"
-  fi
-AC_SUBST(CONFIG_GSL)
-AC_SUBST(GSL_LIBS)
-AM_CONDITIONAL(CONFIG_GSL, [test "$CONFIG_GSL" = "yes"])
+PKG_CHECK_MODULES([GSL], [gsl],[
+    AC_DEFINE(HAVE_LIBGSL,1, [Define if gsl is installed])
+    AC_SUBST(GSL_LIBS)])
   
-CONFIG_LAPACK="yes"
-AC_ARG_ENABLE([lapack],
-	[AS_HELP_STRING([--enable-lapack], [Use LAPACK [[default=yes]]])],
-	[ if test "$enableval" = "no"; then CONFIG_LAPACK="no"; fi], [])
-  
-if test "$CONFIG_LAPACK" = "yes"; then
-#	AC_CHECK_LIB(f2c, main, [], [CONFIG_LAPACK="no"])
-#	AC_CHECK_LIB(blas, main, [], [CONFIG_LAPACK="no"])
-#	AC_CHECK_LIB(tmglib, main, [], [CONFIG_LAPACK="no"])
-	AC_CHECK_LIB(gfortran, main)
-	AC_CHECK_LIB(blas, main)
-	AC_CHECK_LIB(lapack, main, [], [CONFIG_LAPACK="no"])
-#        AX_BLAS([have_blas=yes],[have_blas=no])
-#        AX_LAPACK([have_lapack=yes],[have_lapack=no])
-fi
+PKG_CHECK_MODULES([LAPACK], [lapack],[
+    AC_DEFINE(HAVE_LIBLAPACK,1,[Define if LAPACK is installed])
+    AC_SUBST(LAPACK_LIBS)])
   
 CONFIG_PARI="yes"
 AC_ARG_ENABLE([pari],
diff --git a/src/Makefile.am b/src/Makefile.am
index df15c37..e2b2e82 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -13,7 +13,7 @@ libgiac_la_SOURCES = input_lexer.ll sym2poly.cc gausspol.cc threaded.cc \
   input_lexer.h input_parser.h threaded.h vector.h \
   help.cc  # Ugh..
 
-libgiac_la_LIBADD = $(NTL_LIBS) $(COCOA_LIBS) $(PARI_LIBS) $(GSL_LIBS)
+libgiac_la_LIBADD = $(NTL_LIBS) $(COCOA_LIBS) $(PARI_LIBS) $(GSL_LIBS) $(LAPACK_LIBS)
 
 giacincludedir = $(includedir)/giac
 giacinclude_HEADERS = dispatch.h fraction.h gen.h desolve.h misc.h ti89.h \