source: trunk/m4/yat_gsl.m4 @ 2395

Last change on this file since 2395 was 2395, checked in by Peter, 11 years ago

improve portability; avoid

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id Date
File size: 2.0 KB
Line 
1## $Id: yat_gsl.m4 2395 2011-01-07 00:03:23Z peter $
2
3#   Copyright (C) 2009, 2011 Peter Johansson
4#
5#   This file is part of the yat library, http://dev.thep.lu.se/yat
6#
7#   The yat library is free software; you can redistribute it and/or
8#   modify it under the terms of the GNU General Public License as
9#   published by the Free Software Foundation; either version 3 of the
10#   License, or (at your option) any later version.
11#
12#   The yat library is distributed in the hope that it will be useful,
13#   but WITHOUT ANY WARRANTY; without even the implied warranty of
14#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15#   General Public License for more details.
16#
17#   You should have received a copy of the GNU General Public License
18#   along with yat. If not, see <http://www.gnu.org/licenses/>.
19#
20
21#
22# serial 2 
23#
24# see http://www.gnu.org/software/automake/manual/automake.html#Serials
25
26
27#
28#
29#
30AC_DEFUN([YAT_CHECK_GSL],
31[
32  AC_PREREQ([2.63]) dnl we use YAT_CHECK_GSL_HEADER
33  yat_gsl_status="ok"
34  AC_ARG_WITH([gsl],
35              [AS_HELP_STRING([--with-gsl=DIR], [prefix for gsl installation])])
36
37  AS_VAR_IF([with_gsl], [no], [yat_gsl_status=skip])       
38
39  AS_IF([test "x$yat_gsl_status" = "xok"], [
40           AX_PATH_GSL([$1],,[yat_gsl_status="no"])
41        ])
42
43  AS_IF([test "x$yat_gsl_status" = "xok"],
44        [YAT_CHECK_GSL_HEADER([gsl/gsl_version.h],,
45                              [yat_gsl_status="no-header"])
46        ])
47
48  AS_IF([test "x$yat_gsl_status" = "xok"],
49        [# grep words starting with '-L' in other words LDFLAGS
50         for i in $GSL_LIBS; do
51           AS_IF([AS_ECHO([$i]) | grep '^-L' > /dev/null],
52                 [YAT_LD_ADD_FLAG([LDFLAGS], [$i])])
53         done         
54        ])
55
56  AS_CASE([$yat_gsl_status],
57          [ok], [m4_default([$2], [:])],
58          [skip], [:],
59          [m4_default([$3], [:])])
60
61
62]) # YAT_CHECK_GSL
63
64AC_DEFUN([YAT_CHECK_GSL_HEADER],
65[
66  AC_PREREQ([2.63]) dnl we use YAT_CPP_ADD_FLAG
67  YAT_CPP_ADD_FLAG([CPPFLAGS],[`$GSL_CONFIG --cflags`])
68  AC_CHECK_HEADER([$1], [$2], [$3])
69]) # YAT_CHECK_GSL_HEADER
Note: See TracBrowser for help on using the repository browser.