source: branches/0.5-stable/m4/gsl.m4 @ 2101

Last change on this file since 2101 was 2101, checked in by Peter, 12 years ago

refs #573. do not append GSL_CFLAGS to AM_CXXFLAGS

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