source: trunk/m4/gsl.m4 @ 2724

Last change on this file since 2724 was 2724, checked in by Peter, 7 years ago

set svncopyright:ignore property

  • Property svn:eol-style set to native
File size: 2.4 KB
Line 
1# Configure path for the GNU Scientific Library
2# Christopher R. Gabriel <cgabriel@linux.it>, April 2000
3
4
5AC_DEFUN([AX_PATH_GSL],
6[
7  if test "x${GSL_CONFIG+set}" != xset ; then
8     if test "x$gsl_prefix" != x ; then
9         GSL_CONFIG="$gsl_prefix/bin/gsl-config"
10     fi
11     if test "x$gsl_exec_prefix" != x ; then
12        GSL_CONFIG="$gsl_exec_prefix/bin/gsl-config"
13     fi
14     if test "x$with_gsl" != x ; then
15        GSL_CONFIG="$with_gsl/bin/gsl-config"
16     fi
17  fi
18
19  AC_PATH_PROG(GSL_CONFIG, gsl-config, no)
20  min_gsl_version=ifelse([$1], ,0.2.5,$1)
21  AC_MSG_CHECKING(for GSL - version >= $min_gsl_version)
22  no_gsl=""
23  if test "$GSL_CONFIG" = "no" ; then
24    no_gsl=yes
25    AC_MSG_RESULT([no])
26    AC_MSG_WARN([
27       The gsl-config script installed by GSL could not be found
28       If GSL was installed in PREFIX, make sure PREFIX/bin is in
29       your path, or set the GSL_CONFIG environment variable to the
30       full path to gsl-config.
31    ])
32  else
33    GSL_CFLAGS=`$GSL_CONFIG --cflags`
34    GSL_LIBS=`$GSL_CONFIG --libs`
35    ac_save_LIBS="$LIBS"
36    LIBS="$GSL_LIBS $LIBS"
37    AC_LINK_IFELSE([AC_LANG_PROGRAM(, [return 0])],,[no_gsl=yes]) 
38    LIBS="$ac_save_LIBS"
39  fi
40
41  if test "x$no_gsl" = xyes ; then
42    AC_MSG_RESULT([no])
43    AC_MSG_WARN([
44     The test program failed to compile or link. See the config.log
45     for the exact error that occured. This usually means GSL was
46     incorrectly installed or that you have moved GSL since it was
47     installed. In the latter case, you may want to edit the
48     gsl-config script: $GSL_CONFIG.
49    ])
50  else
51    ac_gsl_version=`$GSL_CONFIG --version`
52    AX_COMPARE_VERSION([$ac_gsl_version], [ge], [$min_gsl_version],,[no_gsl=yes])
53    AC_MSG_RESULT([$ac_gsl_version])
54    if test "x$no_gsl" = xyes ; then
55      AC_MSG_WARN([
56       gsl-config --version returned $ac_gsl_version, but the minimum
57       version of GSL required is $min_gsl_version. If gsl-config is
58       correct, then it is best to upgrade to the required version. If
59       gsl-config was wrong, set the environment variable GSL_CONFIG to
60       point to the correct copy of gsl-config, and remove the file
61       config.cache before re-running configure. 
62      ])
63    fi
64  fi
65
66  if test "x$no_gsl" = x ; then
67     ifelse([$2], , :, [$2])     
68  else
69     ifelse([$3], , :, [$3])
70  fi
71  AC_SUBST(GSL_CFLAGS)
72  AC_SUBST(GSL_LIBS)
73])
74
75AU_ALIAS([AM_PATH_GSL], [AX_PATH_GSL])
Note: See TracBrowser for help on using the repository browser.